summaryrefslogtreecommitdiffstats
path: root/kdecore/ksavefile.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kdecore/ksavefile.cpp
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore/ksavefile.cpp')
-rw-r--r--kdecore/ksavefile.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/kdecore/ksavefile.cpp b/kdecore/ksavefile.cpp
index 35ec51da1..77b0a6b41 100644
--- a/kdecore/ksavefile.cpp
+++ b/kdecore/ksavefile.cpp
@@ -32,19 +32,19 @@
#include <test.h>
#endif
-#include <qdatetime.h>
-#include <qdir.h>
+#include <tqdatetime.h>
+#include <tqdir.h>
#include <kde_file.h>
#include "kapplication.h"
#include "ksavefile.h"
#include "kstandarddirs.h"
-KSaveFile::KSaveFile(const QString &filename, int mode)
+KSaveFile::KSaveFile(const TQString &filename, int mode)
: mTempFile(true)
{
// follow symbolic link, if any
- QString real_filename = KStandardDirs::realFilePath(filename);
+ TQString real_filename = KStandardDirs::realFilePath(filename);
// we only check here if the directory can be written to
// the actual filename isn't written to, but replaced later
@@ -55,7 +55,7 @@ KSaveFile::KSaveFile(const QString &filename, int mode)
return;
}
- if (mTempFile.create(real_filename, QString::fromLatin1(".new"), mode))
+ if (mTempFile.create(real_filename, TQString::fromLatin1(".new"), mode))
{
mFileName = real_filename; // Set filename upon success
@@ -63,7 +63,7 @@ KSaveFile::KSaveFile(const QString &filename, int mode)
// permissions are the same as existing file so the existing
// file's permissions are preserved
KDE_struct_stat stat_buf;
- if (KDE_stat(QFile::encodeName(real_filename), &stat_buf)==0)
+ if (KDE_stat(TQFile::encodeName(real_filename), &stat_buf)==0)
{
// But only if we own the existing file
if (stat_buf.st_uid == getuid())
@@ -115,7 +115,7 @@ KSaveFile::close()
}
if (mTempFile.close())
{
- if (0==KDE_rename(QFile::encodeName(mTempFile.name()), QFile::encodeName(mFileName)))
+ if (0==KDE_rename(TQFile::encodeName(mTempFile.name()), TQFile::encodeName(mFileName)))
return true; // Success!
mTempFile.setError(errno);
}
@@ -142,10 +142,10 @@ write_all(int fd, const char *buf, size_t len)
return 0;
}
-bool KSaveFile::backupFile( const QString& qFilename, const QString& backupDir,
- const QString& backupExtension)
+bool KSaveFile::backupFile( const TQString& qFilename, const TQString& backupDir,
+ const TQString& backupExtension)
{
- QCString cFilename = QFile::encodeName(qFilename);
+ TQCString cFilename = TQFile::encodeName(qFilename);
const char *filename = cFilename.data();
int fd = KDE_open( filename, O_RDONLY );
@@ -159,23 +159,23 @@ bool KSaveFile::backupFile( const QString& qFilename, const QString& backupDir,
return false;
}
- QCString cBackup;
+ TQCString cBackup;
if ( backupDir.isEmpty() )
cBackup = cFilename;
else
{
- QCString nameOnly;
+ TQCString nameOnly;
int slash = cFilename.findRev('/');
if (slash < 0)
nameOnly = cFilename;
else
nameOnly = cFilename.mid(slash + 1);
- cBackup = QFile::encodeName(backupDir);
+ cBackup = TQFile::encodeName(backupDir);
if ( backupDir[backupDir.length()-1] != '/' )
cBackup += '/';
cBackup += nameOnly;
}
- cBackup += QFile::encodeName(backupExtension);
+ cBackup += TQFile::encodeName(backupExtension);
const char *backup = cBackup.data();
int permissions = buff.st_mode & 07777;