endif()
if (WITH_KDE)
- find_package(KF5CoreAddons QUIET)
- set_package_properties(KF5CoreAddons PROPERTIES TYPE REQUIRED
- URL "http://inqlude.org/libraries/kcoreaddons.html"
- DESCRIPTION "framework for solving common problems such as caching, randomization, and more"
- PURPOSE "Required for KDE Frameworks integration"
- )
-
- find_package(KF5TextWidgets QUIET)
- set_package_properties(KF5TextWidgets PROPERTIES TYPE REQUIRED
- URL "http://inqlude.org/libraries/ktextwidgets.html"
- DESCRIPTION "framework providing an assortment of widgets for displaying and editing text"
- PURPOSE "Allows to use extra features provided by KDE Frameworks in input widgets"
+ find_package(KF5 COMPONENTS ConfigWidgets CoreAddons TextWidgets XmlGui QUIET)
+ set_package_properties(KF5 PROPERTIES TYPE REQUIRED
+ URL "http://www.kde.org"
+ DESCRIPTION "KDE Frameworks"
+ PURPOSE "Required for integration into the Plasma desktop"
)
endif()
endif(BUILD_GUI)
+
if (BUILD_CORE)
find_package(Qt5Script QUIET)
set_package_properties(Qt5Script PROPERTIES TYPE REQUIRED
DESCRIPTION "contains tools for handling translation files"
PURPOSE "Required for having translations"
)
+
# Some Qt5 versions do not define a target for lconvert, so we need to find it ourselves
if (Qt5LinguistTools_FOUND)
if (NOT TARGET Qt5::lconvert AND TARGET Qt5::lrelease)
set(LIBS )
set(QT_MODULES )
-if (KDE4_FOUND)
+if (WITH_KDE4)
add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS})
include_directories(${KDE4_INCLUDES})
list(APPEND SOURCES knotificationbackend.cpp)
list(APPEND LIBS ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY} ${KDE4_KNOTIFYCONFIG_LIBRARY})
endif()
+if (WITH_KF5)
+ list(APPEND LIBS KF5::ConfigWidgets KF5::XmlGui)
+endif()
+
if (LIBSNORE_FOUND)
add_definitions(-DHAVE_LIBSNORE)
include_directories(${LIBSNORE_INCLUDE_DIRS})
# include <KWindowSystem>
#endif
+#ifdef HAVE_KF5
+# include <KConfigWidgets/KStandardAction>
+# include <KXmlGui/KHelpMenu>
+#endif
+
#ifdef Q_WS_X11
# include <QX11Info>
#endif
#endif
MainWin::MainWin(QWidget *parent)
-#ifdef HAVE_KDE4
- : KMainWindow(parent),
- _kHelpMenu(new KHelpMenu(this, KGlobal::mainComponent().aboutData())),
+#ifdef HAVE_KDE
+ : KMainWindow(parent), _kHelpMenu(new KHelpMenu(this)),
#else
: QMainWindow(parent),
#endif
setDisconnectedState(); // Disable menus and stuff
-#ifdef HAVE_KDE4
+#ifdef HAVE_KDE
setAutoSaveSettings();
#endif
if (lastBufId.isValid())
s.setValue("LastUsedBufferId", lastBufId.toInt());
-#ifdef HAVE_KDE4
+#ifdef HAVE_KDE
saveAutoSaveSettings();
#endif
}
_normalPos = s.value("MainWinPos", pos()).toPoint();
bool maximized = s.value("MainWinMaximized", false).toBool();
-#ifndef HAVE_KDE4
+#ifndef HAVE_KDE
restoreGeometry(s.value("MainWinGeometry").toByteArray());
if (maximized) {
configureShortcutsAct->setMenuRole(QAction::NoRole);
coll->addAction("ConfigureShortcuts", configureShortcutsAct);
- #ifdef Q_OS_MAC
+#ifdef Q_OS_MAC
QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
this, SLOT(showSettingsDlg()));
configureQuasselAct->setMenuRole(QAction::PreferencesRole);
- #else
+#else
QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
this, SLOT(showSettingsDlg()), QKeySequence(Qt::Key_F7));
- #endif
+#endif
coll->addAction("ConfigureQuassel", configureQuasselAct);
// Help
_settingsMenu->addAction(coll->action("ConfigureQuassel"));
_helpMenu = menuBar()->addMenu(tr("&Help"));
+
_helpMenu->addAction(coll->action("AboutQuassel"));
-#ifndef HAVE_KDE4
+#ifndef HAVE_KDE
_helpMenu->addAction(coll->action("AboutQt"));
#else
_helpMenu->addAction(KStandardAction::aboutKDE(_kHelpMenu, SLOT(aboutKDE()), this));
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef MAINWIN_H_
-#define MAINWIN_H_
+#pragma once
#ifdef HAVE_KDE4
# include <KMainWindow>
+#elif defined HAVE_KF5
+# include <KXmlGui/KMainWindow>
#else
# include <QMainWindow>
#endif
//!\brief The main window of Quassel's QtUi.
class MainWin
-#ifdef HAVE_KDE4
- : public KMainWindow
-{
+#ifdef HAVE_KDE
+ : public KMainWindow {
#else
-: public QMainWindow {
+ : public QMainWindow {
#endif
Q_OBJECT
void disconnectFromCore();
private:
-#ifdef HAVE_KDE4
+#ifdef HAVE_KDE
KHelpMenu *_kHelpMenu;
#endif
friend class QtUi;
};
-
-
-#endif