summaryrefslogtreecommitdiffstats
path: root/kget/kfileio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kget/kfileio.cpp')
-rw-r--r--kget/kfileio.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/kget/kfileio.cpp b/kget/kfileio.cpp
index 63f230bc..51149baa 100644
--- a/kget/kfileio.cpp
+++ b/kget/kfileio.cpp
@@ -42,35 +42,35 @@ TQString kFileToString(const TQString & aFileName, bool aEnsureNL, bool aVerbose
if (!info.exists()) {
if (aVerbose)
- KMessageBox::error(qApp->mainWidget(), i18n("The specified file does not exist:\n%1").arg(aFileName));
- return TQString::null;
+ KMessageBox::error(tqApp->mainWidget(), i18n("The specified file does not exist:\n%1").tqarg(aFileName));
+ return TQString();
}
if (info.isDir()) {
if (aVerbose)
- KMessageBox::error(qApp->mainWidget(), i18n("This is a folder and not a file:\n%1").arg(aFileName));
- return TQString::null;
+ KMessageBox::error(tqApp->mainWidget(), i18n("This is a folder and not a file:\n%1").tqarg(aFileName));
+ return TQString();
}
if (!info.isReadable()) {
if (aVerbose)
- KMessageBox::error(qApp->mainWidget(), i18n("You do not have read permission for the file:\n%1").arg(aFileName));
- return TQString::null;
+ KMessageBox::error(tqApp->mainWidget(), i18n("You do not have read permission for the file:\n%1").tqarg(aFileName));
+ return TQString();
}
if (len <= 0)
- return TQString::null;
+ return TQString();
if (!file.open(IO_Raw | IO_ReadOnly)) {
if (aVerbose)
switch (file.status()) {
case IO_ReadError:
- KMessageBox::error(qApp->mainWidget(), i18n("Could not read file:\n%1").arg(aFileName));
+ KMessageBox::error(tqApp->mainWidget(), i18n("Could not read file:\n%1").tqarg(aFileName));
break;
case IO_OpenError:
- KMessageBox::error(qApp->mainWidget(), i18n("Could not open file:\n%1").arg(aFileName));
+ KMessageBox::error(tqApp->mainWidget(), i18n("Could not open file:\n%1").tqarg(aFileName));
break;
default:
- KMessageBox::error(qApp->mainWidget(), i18n("Error while reading file:\n%1").arg(aFileName));
+ KMessageBox::error(tqApp->mainWidget(), i18n("Error while reading file:\n%1").tqarg(aFileName));
}
- return TQString::null;
+ return TQString();
}
result.resize(len + (int) aEnsureNL + 1);
@@ -82,11 +82,11 @@ TQString kFileToString(const TQString & aFileName, bool aEnsureNL, bool aVerbose
result[len] = '\0';
if (readLen < len) {
- TQString msg = i18n("Could only read %1 bytes of %2.").arg(KGlobal::locale()->formatNumber(readLen,
- 0)).arg(KGlobal::locale()->formatNumber(len, 0));
+ TQString msg = i18n("Could only read %1 bytes of %2.").tqarg(KGlobal::locale()->formatNumber(readLen,
+ 0)).tqarg(KGlobal::locale()->formatNumber(len, 0));
- KMessageBox::error(qApp->mainWidget(), msg);
- return TQString::null;
+ KMessageBox::error(tqApp->mainWidget(), msg);
+ return TQString();
}
kdDebug() << "kFileToString: " << readLen << " bytes read" << endl;
@@ -107,9 +107,9 @@ static bool kBytesToFile(const char *aBuffer, int len, const TQString & aFileNam
if (info.exists()) {
if (aAskIfExists) {
- TQString str = i18n("File %1 exists.\nDo you want to replace it?").arg(aFileName);
+ TQString str = i18n("File %1 exists.\nDo you want to replace it?").tqarg(aFileName);
- rc = KMessageBox::questionYesNo(qApp->mainWidget(), str, TQString::null, i18n("Replace"),KStdGuiItem::cancel());
+ rc = KMessageBox::questionYesNo(tqApp->mainWidget(), str, TQString(), i18n("Replace"),KStdGuiItem::cancel());
if (rc != KMessageBox::Yes)
return FALSE;
}
@@ -124,7 +124,7 @@ static bool kBytesToFile(const char *aBuffer, int len, const TQString & aFileNam
// failed to rename file
if (!aVerbose)
return FALSE;
- rc = KMessageBox::warningContinueCancel(qApp->mainWidget(), i18n("Failed to make a backup copy of %1.\nContinue anyway?").arg(aFileName));
+ rc = KMessageBox::warningContinueCancel(tqApp->mainWidget(), i18n("Failed to make a backup copy of %1.\nContinue anyway?").tqarg(aFileName));
if (rc != KMessageBox::Continue)
return FALSE;
}
@@ -135,13 +135,13 @@ static bool kBytesToFile(const char *aBuffer, int len, const TQString & aFileNam
if (aVerbose)
switch (file.status()) {
case IO_WriteError:
- KMessageBox::error(qApp->mainWidget(), i18n("Could not write to file:\n%1").arg(aFileName));
+ KMessageBox::error(tqApp->mainWidget(), i18n("Could not write to file:\n%1").tqarg(aFileName));
break;
case IO_OpenError:
- KMessageBox::error(qApp->mainWidget(), i18n("Could not open file for writing:\n%1").arg(aFileName));
+ KMessageBox::error(tqApp->mainWidget(), i18n("Could not open file for writing:\n%1").tqarg(aFileName));
break;
default:
- KMessageBox::error(qApp->mainWidget(), i18n("Error while writing file:\n%1").arg(aFileName));
+ KMessageBox::error(tqApp->mainWidget(), i18n("Error while writing file:\n%1").tqarg(aFileName));
}
return FALSE;
}
@@ -149,14 +149,14 @@ static bool kBytesToFile(const char *aBuffer, int len, const TQString & aFileNam
writeLen = file.writeBlock(aBuffer, len);
if (writeLen < 0) {
- KMessageBox::error(qApp->mainWidget(), i18n("Could not write to file:\n%1").arg(aFileName));
+ KMessageBox::error(tqApp->mainWidget(), i18n("Could not write to file:\n%1").tqarg(aFileName));
return FALSE;
} else if (writeLen < len) {
- TQString msg = i18n("Could only write %1 bytes of %2.").arg(KGlobal::locale()->formatNumber(writeLen,
- 0)).arg(KGlobal::locale()->formatNumber(len,
+ TQString msg = i18n("Could only write %1 bytes of %2.").tqarg(KGlobal::locale()->formatNumber(writeLen,
+ 0)).tqarg(KGlobal::locale()->formatNumber(len,
0));
- KMessageBox::error(qApp->mainWidget(), msg);
+ KMessageBox::error(tqApp->mainWidget(), msg);
return FALSE;
}