diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kget/kfileio.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip |
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kget/kfileio.cpp')
-rw-r--r-- | kget/kfileio.cpp | 50 |
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; } |