diff --git a/kcms/kfontinst/apps/Installer.h b/kcms/kfontinst/apps/Installer.h --- a/kcms/kfontinst/apps/Installer.h +++ b/kcms/kfontinst/apps/Installer.h @@ -28,7 +28,7 @@ #include class QWidget; -class KTempDir; +class QTemporaryDir; namespace KFI { @@ -45,7 +45,7 @@ private: QWidget *itsParent; - KTempDir *itsTempDir; + QTemporaryDir *itsTempDir; }; } diff --git a/kcms/kfontinst/kcmfontinst/FontsPackage.h b/kcms/kfontinst/kcmfontinst/FontsPackage.h --- a/kcms/kfontinst/kcmfontinst/FontsPackage.h +++ b/kcms/kfontinst/kcmfontinst/FontsPackage.h @@ -24,7 +24,7 @@ * Boston, MA 02110-1301, USA. */ -class KTempDir; +class QTemporaryDir; #include #include @@ -34,7 +34,7 @@ namespace FontsPackage { - QSet extract(const QString &fileName, KTempDir **tempDir); + QSet extract(const QString &fileName, QTemporaryDir **tempDir); } } diff --git a/kcms/kfontinst/kcmfontinst/FontsPackage.cpp b/kcms/kfontinst/kcmfontinst/FontsPackage.cpp --- a/kcms/kfontinst/kcmfontinst/FontsPackage.cpp +++ b/kcms/kfontinst/kcmfontinst/FontsPackage.cpp @@ -22,7 +22,7 @@ */ #include -#include +#include #include #include "FontsPackage.h" #include "KfiConstants.h" @@ -34,7 +34,7 @@ namespace FontsPackage { -QSet extract(const QString &fileName, KTempDir **tempDir) +QSet extract(const QString &fileName, QTemporaryDir **tempDir) { QSet urls; @@ -64,25 +64,25 @@ { if(!(*tempDir)) { - (*tempDir)=new KTempDir(QDir::tempPath() + "/" KFI_TMP_DIR_PREFIX); + (*tempDir)=new QTemporaryDir(QDir::tempPath() + "/" KFI_TMP_DIR_PREFIX); (*tempDir)->setAutoRemove(true); } - ((KArchiveFile *)entry)->copyTo((*tempDir)->name()); + ((KArchiveFile *)entry)->copyTo((*tempDir)->path()); QString name(entry->name()); // // Cant install hidden fonts, therefore need to // unhide 1st! if(Misc::isHidden(name)) { - ::rename(QFile::encodeName((*tempDir)->name()+name).data(), - QFile::encodeName((*tempDir)->name()+name.mid(1)).data()); + ::rename(QFile::encodeName((*tempDir)->path()+QLatin1Char('/')+name).data(), + QFile::encodeName((*tempDir)->path()+QLatin1Char('/')+name.mid(1)).data()); name=name.mid(1); } - urls.insert(QUrl((*tempDir)->name()+name)); + urls.insert(QUrl((*tempDir)->path()+QLatin1Char('/')+name)); } } } diff --git a/kcms/kfontinst/kcmfontinst/JobRunner.h b/kcms/kfontinst/kcmfontinst/JobRunner.h --- a/kcms/kfontinst/kcmfontinst/JobRunner.h +++ b/kcms/kfontinst/kcmfontinst/JobRunner.h @@ -36,7 +36,7 @@ class QDialogButtonBox; class QAbstractButton; class KJob; -class KTempDir; +class QTemporaryDir; namespace KFI { @@ -130,7 +130,7 @@ bool itsAutoSkip, itsCancelClicked, itsModified; - KTempDir *itsTempDir; + QTemporaryDir *itsTempDir; QString itsCurrentFile; CActionLabel *itsActionLabel; QStackedWidget *itsStack; diff --git a/kcms/kfontinst/kcmfontinst/JobRunner.cpp b/kcms/kfontinst/kcmfontinst/JobRunner.cpp --- a/kcms/kfontinst/kcmfontinst/JobRunner.cpp +++ b/kcms/kfontinst/kcmfontinst/JobRunner.cpp @@ -27,7 +27,7 @@ #include "Fc.h" #include "ActionLabel.h" #include -#include +#include #include #include #include @@ -686,11 +686,11 @@ // Need to do actual download... if(!itsTempDir) { - itsTempDir=new KTempDir(QDir::tempPath() + "/fontinst"); + itsTempDir=new QTemporaryDir(QDir::tempPath() + "/fontinst"); itsTempDir->setAutoRemove(true); } - QString tempName(itsTempDir->name()+QChar('/')+Misc::getFile(url.path())); + QString tempName(itsTempDir->path()+QLatin1Char('/')+Misc::getFile(url.path())); if(KIO::NetAccess::download(url, tempName, 0L)) return tempName; else diff --git a/kcms/kfontinst/kcmfontinst/KCmFontInst.h b/kcms/kfontinst/kcmfontinst/KCmFontInst.h --- a/kcms/kfontinst/kcmfontinst/KCmFontInst.h +++ b/kcms/kfontinst/kcmfontinst/KCmFontInst.h @@ -34,7 +34,7 @@ class KPushButton; class KProgressDialog; -class KTempDir; +class QTemporaryDir; class KToggleAction; class KActionMenu; class KAction; @@ -128,7 +128,7 @@ KIO::Job *itsJob; KProgressDialog *itsProgress; CUpdateDialog *itsUpdateDialog; - KTempDir *itsTempDir; + QTemporaryDir *itsTempDir; QProcess *itsPrintProc; QSet itsDeletedFonts; QList itsModifiedUrls; diff --git a/kcms/kfontinst/kio/KioFonts.h b/kcms/kfontinst/kio/KioFonts.h --- a/kcms/kfontinst/kio/KioFonts.h +++ b/kcms/kfontinst/kio/KioFonts.h @@ -28,7 +28,7 @@ #include #include -class KTempDir; +class QTemporaryDir; class QUrl; namespace KFI @@ -76,7 +76,7 @@ private: FontInstInterface *itsInterface; - KTempDir *itsTempDir; + QTemporaryDir *itsTempDir; QHash itsUserCache; QHash itsGroupCache; }; diff --git a/kcms/kfontinst/kio/KioFonts.cpp b/kcms/kfontinst/kio/KioFonts.cpp --- a/kcms/kfontinst/kio/KioFonts.cpp +++ b/kcms/kfontinst/kio/KioFonts.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -231,12 +231,12 @@ { if(!itsTempDir) { - itsTempDir=new KTempDir(QDir::tempPath() + - QString::fromLatin1("/kio_fonts_")+QString::number(getpid())); + itsTempDir=new QTemporaryDir(QDir::tempPath() + + QString::fromLatin1("/kio_fonts_")+QString::number(getpid())); itsTempDir->setAutoRemove(true); } - QString tempFile(itsTempDir->name()+QChar('/')+url.fileName()); + QString tempFile(itsTempDir->path()+QLatin1Char('/')+url.fileName()); QFile dest(tempFile); if (dest.open(QIODevice::WriteOnly)) diff --git a/kcms/kfontinst/thumbnail/FontThumbnail.cpp b/kcms/kfontinst/thumbnail/FontThumbnail.cpp --- a/kcms/kfontinst/thumbnail/FontThumbnail.cpp +++ b/kcms/kfontinst/thumbnail/FontThumbnail.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ bool CFontThumbnail::create(const QString &path, int width, int height, QImage &img) { QString realPath(path); - KTempDir *tempDir = 0; + QTemporaryDir *tempDir = 0; KFI_DBUG << "Create font thumbnail for:" << path << endl; @@ -83,21 +83,21 @@ if(entry && entry->isFile()) { delete tempDir; - tempDir=new KTempDir(QDir::tempPath() + "/" KFI_TMP_DIR_PREFIX); + tempDir=new QTemporaryDir(QDir::tempPath() + "/" KFI_TMP_DIR_PREFIX); tempDir->setAutoRemove(true); - ((KArchiveFile *)entry)->copyTo(tempDir->name()); + ((KArchiveFile *)entry)->copyTo(tempDir->path()); - QString mime(KMimeType::findByPath(tempDir->name()+entry->name())->name()); + QString mime(KMimeType::findByPath(tempDir->path()+QLatin1Char('/')+entry->name())->name()); if(mime=="application/x-font-ttf" || mime=="application/x-font-otf" || mime=="application/x-font-type1") { - realPath=tempDir->name()+entry->name(); + realPath=tempDir->path()+QLatin1Char('/')+entry->name(); break; } else - ::unlink(QFile::encodeName(tempDir->name()+entry->name()).data()); + ::unlink(QFile::encodeName(tempDir->path()+QLatin1Char('/')+entry->name()).data()); } } } diff --git a/kcms/kfontinst/viewpart/FontViewPart.h b/kcms/kfontinst/viewpart/FontViewPart.h --- a/kcms/kfontinst/viewpart/FontViewPart.h +++ b/kcms/kfontinst/viewpart/FontViewPart.h @@ -41,7 +41,7 @@ class QAction; class KAction; class KIntNumInput; -class KTempDir; +class QTemporaryDir; namespace KFI { @@ -98,7 +98,7 @@ BrowserExtension *itsExtension; QProcess *itsProc; // KUrl itsMetaUrl; - KTempDir *itsTempDir; + QTemporaryDir *itsTempDir; Misc::TFont itsFontDetails; FontInstInterface *itsInterface; bool itsOpening; diff --git a/kcms/kfontinst/viewpart/FontViewPart.cpp b/kcms/kfontinst/viewpart/FontViewPart.cpp --- a/kcms/kfontinst/viewpart/FontViewPart.cpp +++ b/kcms/kfontinst/viewpart/FontViewPart.cpp @@ -50,7 +50,7 @@ #include //#include #include -#include +#include #include #include #include @@ -290,23 +290,23 @@ if(entry && entry->isFile()) { delete itsTempDir; - itsTempDir=new KTempDir(QDir::tempPath() + "/" KFI_TMP_DIR_PREFIX); + itsTempDir=new QTemporaryDir(QDir::tempPath() + "/" KFI_TMP_DIR_PREFIX); itsTempDir->setAutoRemove(true); - ((KArchiveFile *)entry)->copyTo(itsTempDir->name()); + ((KArchiveFile *)entry)->copyTo(itsTempDir->path()); - QString mime(KMimeType::findByPath(itsTempDir->name()+entry->name())->name()); + QString mime(KMimeType::findByPath(itsTempDir->path()+QLatin1Char('/')+entry->name())->name()); if(mime=="application/x-font-ttf" || mime=="application/x-font-otf" || mime=="application/x-font-type1") { - fontFile=itsTempDir->name()+entry->name(); - //setLocalFilePath(itsTempDir->name()+entry->name()); + fontFile=itsTempDir->path()+QLatin1Char('/')+entry->name(); + //setLocalFilePath(itsTempDir->path()+QLatin1Char('/')+entry->name()); // itsMetaUrl=QUrl::fromLocalFile(localFilePath()); break; } else - ::unlink(QFile::encodeName(itsTempDir->name()+entry->name()).data()); + ::unlink(QFile::encodeName(itsTempDir->path()+QLatin1Char('/')+entry->name()).data()); } } }