diff --git a/kcms/kfontinst/apps/CMakeLists.txt b/kcms/kfontinst/apps/CMakeLists.txt --- a/kcms/kfontinst/apps/CMakeLists.txt +++ b/kcms/kfontinst/apps/CMakeLists.txt @@ -19,14 +19,12 @@ KF5::KIOCore KF5::KIOWidgets KF5::XmlGui - KF5::KDELibs4Support ${X11_X11_LIB} kfontinst ) target_link_libraries(kfontprint_bin Qt5::PrintSupport KF5::IconThemes - KF5::KDELibs4Support ${X11_X11_LIB} ${FREETYPE_LIBRARIES} kfontinstui diff --git a/kcms/kfontinst/apps/CreateParent.h b/kcms/kfontinst/apps/CreateParent.h --- a/kcms/kfontinst/apps/CreateParent.h +++ b/kcms/kfontinst/apps/CreateParent.h @@ -27,7 +27,6 @@ #include #include #include -#include // // *Very* hacky way to get some KDE dialogs to appear to be transient diff --git a/kcms/kfontinst/dbus/CMakeLists.txt b/kcms/kfontinst/dbus/CMakeLists.txt --- a/kcms/kfontinst/dbus/CMakeLists.txt +++ b/kcms/kfontinst/dbus/CMakeLists.txt @@ -13,11 +13,11 @@ set_target_properties(fontinst_bin PROPERTIES OUTPUT_NAME fontinst) target_link_libraries(fontinst_bin - Qt5::DBus Qt5::Xml ${FONTCONFIG_LIBRARIES} kfontinst) + Qt5::DBus Qt5::Xml KF5::Auth ${FONTCONFIG_LIBRARIES} kfontinst) set_target_properties(fontinst_helper PROPERTIES OUTPUT_NAME fontinst_helper) target_link_libraries(fontinst_helper - Qt5::DBus Qt5::Xml ${FONTCONFIG_LIBRARIES} kfontinst) + Qt5::DBus Qt5::Xml KF5::Auth ${FONTCONFIG_LIBRARIES} kfontinst) install(TARGETS fontinst_bin DESTINATION ${KAUTH_HELPER_INSTALL_DIR} ) install(TARGETS fontinst_helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR} ) diff --git a/kcms/kfontinst/dbus/Folder.cpp b/kcms/kfontinst/dbus/Folder.cpp --- a/kcms/kfontinst/dbus/Folder.cpp +++ b/kcms/kfontinst/dbus/Folder.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include "Folder.h" #include "FcConfig.h" diff --git a/kcms/kfontinst/kcmfontinst/CMakeLists.txt b/kcms/kfontinst/kcmfontinst/CMakeLists.txt --- a/kcms/kfontinst/kcmfontinst/CMakeLists.txt +++ b/kcms/kfontinst/kcmfontinst/CMakeLists.txt @@ -13,7 +13,6 @@ KF5::KIOWidgets KF5::XmlGui KF5::NewStuff - KF5::KDELibs4Support kfontinstui kfontinst ${X11_LIBRARIES} diff --git a/kcms/kfontinst/kcmfontinst/DuplicatesDialog.cpp b/kcms/kfontinst/kcmfontinst/DuplicatesDialog.cpp --- a/kcms/kfontinst/kcmfontinst/DuplicatesDialog.cpp +++ b/kcms/kfontinst/kcmfontinst/DuplicatesDialog.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #if defined USE_POLICYKIT && USE_POLICYKIT==1 #include #endif @@ -166,7 +165,7 @@ details.append(*fit); details.append(""); details.append(KFormat().formatByteSize(info.size())); - details.append(KLocale::global()->formatDateTime(info.created())); + details.append(QLocale().toString(info.created())); if(info.isSymLink()) details.append(info.readLink()); new QTreeWidgetItem(top, details); 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 @@ -44,8 +44,6 @@ #include #include #include -#include -#include #include #include #include @@ -53,6 +51,7 @@ #include #include #include +#include #include "config-fontinst.h" #define CFG_GROUP "Runner Dialog" diff --git a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp --- a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp +++ b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp @@ -49,16 +49,15 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include -#include #include #include #include @@ -583,7 +582,7 @@ static const int constSizes[]={0, 12, 18, 24, 36, 48}; QSet::ConstIterator it(fonts.begin()), end(fonts.end()); - KTemporaryFile tmpFile; + QTemporaryFile tmpFile; bool useFile(fonts.count()>16), startProc(true); QStringList args; @@ -593,6 +592,10 @@ else itsPrintProc->kill(); + QString title = QGuiApplication::applicationDisplayName(); + if (title.isEmpty()) + title = QCoreApplication::applicationName(); + // // If we have lots of fonts to print, pass kfontinst a tempory groups file to print // instead of passing font by font... @@ -607,8 +610,8 @@ << (*it).styleInfo << endl; args << "--embed" << QString().sprintf("0x%x", (unsigned int)window()->winId()) - << "--caption" << KGlobal::caption().toUtf8() - << "--icon" << "preferences-desktop-font-installer" + << "--qwindowtitle" << title + << "--qwindowicon" << "preferences-desktop-font-installer" << "--size" << QString().setNum(constSizes[dlg.chosenSize() < 6 ? dlg.chosenSize() : 2]) << "--listfile" << tmpFile.fileName() << "--deletefile"; @@ -622,8 +625,8 @@ else { args << "--embed" << QString().sprintf("0x%x", (unsigned int)window()->winId()) - << "--caption" << KGlobal::caption().toUtf8() - << "--icon" << "preferences-desktop-font-installer" + << "--qwindowtitle" << title + << "--qwindowicon" << "preferences-desktop-font-installer" << "--size" << QString().setNum(constSizes[dlg.chosenSize()<6 ? dlg.chosenSize() : 2]); for(; it!=end; ++it) 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 @@ -25,8 +25,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -64,7 +63,7 @@ } QCoreApplication app(argc, argv); - KComponentData componentData("kio_" KFI_KIO_FONTS_PROTOCOL); + QCoreApplication::setApplicationName("kio_" KFI_KIO_FONTS_PROTOCOL); KFI::CKioFonts slave(argv[2], argv[3]); slave.dispatchLoop(); @@ -380,7 +379,7 @@ realPath=(*files.begin()); else // Font is made up of multiple files - so create .zip of them all! { - KTemporaryFile tmpFile; + QTemporaryFile tmpFile; if(tmpFile.open()) { diff --git a/kcms/kfontinst/lib/CMakeLists.txt b/kcms/kfontinst/lib/CMakeLists.txt --- a/kcms/kfontinst/lib/CMakeLists.txt +++ b/kcms/kfontinst/lib/CMakeLists.txt @@ -8,7 +8,7 @@ Qt5::Xml Qt5::DBus KF5::I18n - KF5::KDELibs4Support + KF5::KIOCore ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES} XCB::XCB diff --git a/kcms/kfontinst/lib/FcEngine.cpp b/kcms/kfontinst/lib/FcEngine.cpp --- a/kcms/kfontinst/lib/FcEngine.cpp +++ b/kcms/kfontinst/lib/FcEngine.cpp @@ -29,14 +29,13 @@ #include #include #include -#include -#include -#include -#include "fixx11h.h" #include #include #include "File.h" #include +#include +#include +#include //#define KFI_FC_DEBUG #define KFI_PREVIEW_GROUP "KFontInst Preview Settings" diff --git a/kcms/kfontinst/lib/WritingSystems.cpp b/kcms/kfontinst/lib/WritingSystems.cpp --- a/kcms/kfontinst/lib/WritingSystems.cpp +++ b/kcms/kfontinst/lib/WritingSystems.cpp @@ -21,7 +21,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include #include "WritingSystems.h" @@ -29,7 +29,7 @@ namespace KFI { -K_GLOBAL_STATIC(WritingSystems, theInstance) +Q_GLOBAL_STATIC(WritingSystems, theInstance) WritingSystems * WritingSystems::instance() { diff --git a/kcms/kfontinst/lib/kfontinst_export.h b/kcms/kfontinst/lib/kfontinst_export.h --- a/kcms/kfontinst/lib/kfontinst_export.h +++ b/kcms/kfontinst/lib/kfontinst_export.h @@ -22,23 +22,22 @@ #ifndef KFONTINST_EXPORT_H #define KFONTINST_EXPORT_H -/* needed for KDE_EXPORT macros */ -#include +#include #if defined _WIN32 || defined _WIN64 #ifndef KFONTINST_EXPORT # if defined(MAKE_KFONTINST_LIB) -# define KFONTINST_EXPORT KDE_EXPORT +# define KFONTINST_EXPORT Q_DECL_EXPORT # else -# define KFONTINST_EXPORT KDE_IMPORT +# define KFONTINST_EXPORT Q_DECL_IMPORT # endif #endif #else /* UNIX */ -#define KFONTINST_EXPORT KDE_EXPORT +#define KFONTINST_EXPORT Q_DECL_EXPORT #endif diff --git a/kcms/kfontinst/thumbnail/FontThumbnail.h b/kcms/kfontinst/thumbnail/FontThumbnail.h --- a/kcms/kfontinst/thumbnail/FontThumbnail.h +++ b/kcms/kfontinst/thumbnail/FontThumbnail.h @@ -24,7 +24,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include "FcEngine.h" 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 @@ -28,6 +28,8 @@ #include "PreviewSelectAction.h" #include "FontInstInterface.h" #include "FontInst.h" +#include "config-workspace.h" +#include #include #include #include @@ -41,9 +43,8 @@ #include #include #include -#include #include -#include +#include #include #include #include @@ -110,7 +111,8 @@ itsFrame->setFocusPolicy(Qt::ClickFocus); previewFrame->setFrameShape(QFrame::StyledPanel); previewFrame->setFrameShadow(QFrame::Sunken); - setComponentData(KComponentData(KFI_NAME)); + KAboutData aboutData(KFI_NAME, i18n("FontViewPart"), WORKSPACE_VERSION_STRING); + setComponentData(aboutData); itsPreview=new CFontPreview(previewFrame); itsPreview->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); @@ -411,9 +413,13 @@ else itsProc->kill(); + QString title = QGuiApplication::applicationDisplayName(); + if (title.isEmpty()) + title = QCoreApplication::applicationName(); + args << "--embed" << QString().sprintf("0x%x", (unsigned int)(itsFrame->window()->winId())) - << "--caption" << KGlobal::caption().toUtf8() - << "--icon" << "kfontview" + << "--qwindowtitle" << title + << "--qwindowicon" << "kfontview" << url().toDisplayString(); connect(itsProc, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(installlStatus())); @@ -460,19 +466,23 @@ { QStringList args; + QString title = QGuiApplication::applicationDisplayName(); + if (title.isEmpty()) + title = QCoreApplication::applicationName(); + if(!itsFontDetails.family.isEmpty()) { args << "--embed" << QString().sprintf("0x%x", (unsigned int)(itsFrame->window()->winId())) - << "--caption" << KGlobal::caption().toUtf8() - << "--icon" << "kfontview" + << "--qwindowtitle" << title + << "--qwindowicon" << "kfontview" << "--size" << "0" << "--pfont" << QString(itsFontDetails.family+','+QString().setNum(itsFontDetails.styleInfo)); } #ifdef KFI_PRINT_APP_FONTS else args << "--embed" << QString().sprintf("0x%x", (unsigned int)(itsFrame->window()->winId())) - << "--caption" << KGlobal::caption().toUtf8() - << "--icon" << "kfontview" + << "--qwindowtitle" << title + << "--qwindowicon" << "kfontview" << "--size " << "0" << localFilePath() << QString().setNum(KFI_NO_STYLE_INFO);