[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [konversation/frameworks] /: Remove some uses of KLocale, KGlobal and KGlobalSettings
From:       Peter Simonsson <peter.simonsson () gmail ! com>
Date:       2014-10-31 20:21:40
Message-ID: E1XkIhY-0002Ho-2R () scm ! kde ! org
[Download RAW message or body]

Git commit 86fe8f7b149062e13174b7a6b680e1fc6956e778 by Peter Simonsson.
Committed on 31/10/2014 at 20:05.
Pushed by psn into branch 'frameworks'.

Remove some uses of KLocale, KGlobal and KGlobalSettings

CCBUG:337518

M  +4    -0    CMakeLists.txt
M  +4    -0    src/CMakeLists.txt
M  +1    -1    src/application.cpp
M  +0    -1    src/application.h
M  +1    -2    src/konsolepanel.cpp
M  +2    -2    src/mainwindow.cpp
M  +1    -3    src/scriptlauncher.cpp
M  +2    -4    src/urlcatcher.cpp

http://commits.kde.org/konversation/86fe8f7b149062e13174b7a6b680e1fc6956e778

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 838ebdd..4b7316d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,10 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
     WidgetsAddons
     GlobalAccel
     DBusAddons
+    Notifications
+    WindowSystem
+    IconThemes
+    ItemViews
 )
 
 find_package(Phonon4Qt5 4.6.60 REQUIRED)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6aa5b3b..788b584 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -229,6 +229,10 @@ target_link_libraries(konversation
     KF5::GlobalAccel
     KF5::DBusAddons
     KF5::CoreAddons
+    KF5::Notifications
+    KF5::WindowSystem
+    KF5::IconThemes
+    KF5::ItemViews
     Phonon::phonon4qt5)
 
 if (Qca_FOUND)
diff --git a/src/application.cpp b/src/application.cpp
index b81f034..fcbc9ce 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -45,7 +45,7 @@
 #include <KRun>
 #include <KConfig>
 #include <KShell>
-#include <KCharMacroExpander>
+#include <KMacroExpander>
 #include <kwallet.h>
 #include <KTextEdit>
 #include <KSharedConfig>
diff --git a/src/application.h b/src/application.h
index f59da15..0e0183f 100644
--- a/src/application.h
+++ b/src/application.h
@@ -59,7 +59,6 @@ namespace KWallet
 }
 
 
-// FIXME KF5 port: See frameworks-qapp branch for start of port to QApplication and \
QCommandLineParser.  class Application : public QApplication
 {
     Q_OBJECT
diff --git a/src/konsolepanel.cpp b/src/konsolepanel.cpp
index 1872411..6cf84ff 100644
--- a/src/konsolepanel.cpp
+++ b/src/konsolepanel.cpp
@@ -18,7 +18,6 @@
 #include <QLabel>
 #include <QHBoxLayout>
 
-#include <KApplication>
 #include <QDebug>
 #include <QIcon>
 #include <KLocalizedString>
@@ -116,7 +115,7 @@ void KonsolePanel::partDestroyed()
 void KonsolePanel::manageKonsoleProfiles()
 {
     QMetaObject::invokeMethod(k_part, "showManageProfilesDialog",
-        Qt::QueuedConnection, Q_ARG(QWidget*, KApplication::activeWindow()));
+        Qt::QueuedConnection, Q_ARG(QWidget*, QApplication::activeWindow()));
 }
 
 void KonsolePanel::konsoleChanged(const QString& /* data */)
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index c93410c..7f71328 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -48,8 +48,8 @@
 #include <KStandardShortcut>
 #include <KActionMenu>
 #include <KNotifyConfigWidget>
-#include <KGlobalSettings>
 #include <KGlobalAccel>
+#include <KIconLoader>
 
 MainWindow::MainWindow() : KXmlGuiWindow(0)
 {
@@ -701,7 +701,7 @@ void MainWindow::updateTrayIcon()
             // set up system tray
             m_trayIcon = new Konversation::TrayIcon(this);
             connect(this, SIGNAL(endNotification()), m_trayIcon, \
                SLOT(endNotification()));
-            connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), m_trayIcon, \
SLOT(updateAppearance())); +            connect(KIconLoader::global(), \
                SIGNAL(iconChanged(int)), m_trayIcon, SLOT(updateAppearance()));
             QMenu *trayMenu = qobject_cast<QMenu*>(m_trayIcon->contextMenu());
             trayMenu->addAction(actionCollection()->action(QLatin1String(KStandardAction::name(KStandardAction::Preferences))));
                
             trayMenu->addAction(actionCollection()->action(QLatin1String(KStandardAction::name(KStandardAction::ConfigureNotifications))));
                
diff --git a/src/scriptlauncher.cpp b/src/scriptlauncher.cpp
index ed32a00..f818fb1 100644
--- a/src/scriptlauncher.cpp
+++ b/src/scriptlauncher.cpp
@@ -17,15 +17,13 @@
 
 #include <QFileInfo>
 
-#include <KGlobal>
 #include <KProcess>
-#include <KLocale>
 #include <QStandardPaths>
 
 
 ScriptLauncher::ScriptLauncher(QObject* parent) : QObject(parent)
 {
-    qputenv("KONVERSATION_LANG", KLocale::global()->language().toLatin1());
+    qputenv("KONVERSATION_LANG", QLocale().name().toLatin1());
 
     QStringList pythonPath(QProcessEnvironment::systemEnvironment().value(QStringLiteral("PYTHONPATH")).split(QLatin1Char(':'), \
                QString::SkipEmptyParts));
     pythonPath << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, \
                QStringLiteral("konversation/scripting_support/python"),
diff --git a/src/urlcatcher.cpp b/src/urlcatcher.cpp
index 620a3fa..e8531d4 100644
--- a/src/urlcatcher.cpp
+++ b/src/urlcatcher.cpp
@@ -31,9 +31,7 @@
 #include <QFileDialog>
 #include <KFilterProxySearchLine>
 #include <KIO/CopyJob>
-#include <KGlobal>
 #include <QIcon>
-#include <KLocale>
 #include <KLocalizedString>
 #include <QMenu>
 #include <KMessageBox>
@@ -52,7 +50,7 @@ UrlDateItem::~UrlDateItem()
 QVariant UrlDateItem::data(int role) const
 {
     if (role == Qt::DisplayRole)
-        return KLocale::global()->formatDateTime(QStandardItem::data().toDateTime(), \
KLocale::ShortDate, true); +        return \
QLocale().toString(QStandardItem::data().toDateTime(), QLocale::ShortFormat);  
     return QStandardItem::data(role);
 }
@@ -367,7 +365,7 @@ void UrlCatcher::saveUrlModel()
         QTextStream stream(&file);
 
         stream << i18n("Konversation URL List: %1\n\n",
-            KLocale::global()->formatDateTime(QDateTime::currentDateTime(), \
KLocale::LongDate, true)); +            \
QLocale().toString(QDateTime::currentDateTime(), QLocale::LongFormat));  
         for (int r = 0; r < rows; r++)
         {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic