Commit 16b8db13 authored by Christoph Feck's avatar Christoph Feck

Initial port to KF5

Compiles and runs (using kdelibs4support), but detection of
QAccessibleClient has been disabled, because it would find
the KDE4 version.

CCMAIL: frederik.gladhorn@digia.com
parent 03100aaf
project(kmag)
find_package(KDE4 REQUIRED)
include (KDE4Defaults)
include (MacroLibrary)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set(QT_MIN_VERSION "5.2.0")
macro_optional_find_package(QAccessibilityClient)
macro_log_feature(QAccessibilityClient_FOUND "qaccessibilityclient" "KDE client-side accessibility library" "https://projects.kde.org/projects/playground/accessibility/libkdeaccessibilityclient" FALSE "" "Required to enable keyboard focus tracking.")
find_package(ECM 1.3.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
add_definitions(-DTRANSLATION_DOMAIN="kmag")
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
include(FeatureSummary)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core
Widgets
)
find_package(KF5 REQUIRED COMPONENTS
KDELibs4Support
)
#macro_optional_find_package(QAccessibilityClient)
#macro_log_feature(QAccessibilityClient_FOUND "qaccessibilityclient" "KDE client-side accessibility library" "https://projects.kde.org/projects/playground/accessibility/libkdeaccessibilityclient" FALSE "" "Required to enable keyboard focus tracking.")
configure_file(
"${PROJECT_SOURCE_DIR}/focustrackconfig.h.in"
"${PROJECT_BINARY_DIR}/focustrackconfig.h")
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
......@@ -32,21 +49,21 @@ set(kmag_SRCS
colorsim.cpp
main.cpp )
kde4_add_executable(kmag ${kmag_SRCS})
add_executable(kmag ${kmag_SRCS})
target_link_libraries(kmag ${KDE4_KIO_LIBS})
target_link_libraries(kmag Qt5::Core Qt5::Widgets KF5::KDELibs4Support)
if(QAccessibilityClient_FOUND)
target_link_libraries(kmag ${QACCESSIBILITYCLIENT_LIBRARY})
endif(QAccessibilityClient_FOUND)
install(TARGETS kmag ${INSTALL_TARGETS_DEFAULT_ARGS} )
macro_display_feature_log()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
########### install files ###############
install( PROGRAMS kmag.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES kmagui.rc DESTINATION ${DATA_INSTALL_DIR}/kmag )
install( FILES kmagui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kmag )
kde4_install_icons( ${ICON_INSTALL_DIR} )
......@@ -33,7 +33,7 @@ Citations:
#include "colorsim.h"
// include files for Qt
#include <QtGui/QColor>
#include <QColor>
#include <math.h>
......
......@@ -19,8 +19,8 @@
#define KMAGCOLORSIM_H
// include files for Qt
#include <QtGui/QImage>
#include <QtGui/QPixmap>
#include <QImage>
#include <QPixmap>
namespace ColorSim {
/**
......
########### install files ###############
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kmag)
kde4_create_manpage(man-kmag.1.docbook 1 INSTALL_DESTINATION ${MAN_INSTALL_DIR})
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kmag)
kdoctools_create_manpage(man-kmag.1.docbook 1 INSTALL_DESTINATION ${MAN_INSTALL_DIR})
......@@ -22,15 +22,15 @@
***************************************************************************/
// include files for QT
#include <QtCore/QDir>
#include <QtCore/QPointer>
#include <QtGui/QPrintDialog>
#include <QtGui/QPainter>
#include <QtGui/QLayout>
#include <QtGui/QClipboard>
#include <QtGui/QContextMenuEvent>
#include <QtGui/QPixmap>
#include <QtGui/QDesktopWidget>
#include <QDir>
#include <QPointer>
#include <QPrintDialog>
#include <QPainter>
#include <QLayout>
#include <QClipboard>
#include <QContextMenuEvent>
#include <QPixmap>
#include <QDesktopWidget>
// include files for KDE
#include <kxmlguiclient.h>
......@@ -50,6 +50,7 @@
#include <kmenubar.h>
#include <klocale.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kdebug.h>
#include <kstandardaction.h>
#include <khelpmenu.h>
......@@ -63,7 +64,7 @@
#include <kdeprintdialog.h>
// application specific includes
#include "kmag.moc"
#include "kmag.h"
#include "kmagzoomview.h"
#include "kmagselrect.h"
......@@ -583,7 +584,7 @@ void KmagApp::saveZoomPixmap()
toggled = true;
}
KUrl url = KFileDialog::getSaveUrl(QString(),
QUrl url = KFileDialog::getSaveUrl(QString(),
KImageIO::pattern(KImageIO::Writing),
0,i18n("Save Snapshot As"));
......@@ -602,7 +603,7 @@ void KmagApp::saveZoomPixmap()
KMessageBox::error(0, i18n("Unable to upload file over the network."),
i18n("Error Writing File"));
} else {
KMessageBox::information(0, i18n("Current zoomed image saved to\n%1", url.prettyUrl()),
KMessageBox::information(0, i18n("Current zoomed image saved to\n%1", url.toDisplayString()),
i18n("Information"), QLatin1String( "save_confirm" ));
}
}
......@@ -615,7 +616,7 @@ void KmagApp::saveZoomPixmap()
KMessageBox::error(0, i18n("Unable to save file. Please check if you have permission to write to the directory."),
i18n("Error Writing File"));
} else {
KMessageBox::information(0, i18n("Current zoomed image saved to\n%1", url.prettyUrl()),
KMessageBox::information(0, i18n("Current zoomed image saved to\n%1", url.toDisplayString()),
i18n("Information"), QLatin1String( "save_confirm" ));
}
}
......
......@@ -28,14 +28,15 @@
#include "focustrackconfig.h"
// include files for Qt
#include <QtGui/QContextMenuEvent>
#include <QtGui/QPrinter>
#include <QContextMenuEvent>
#include <QPrinter>
// include files for KDE
#include <kxmlguiwindow.h>
#include <kaction.h>
#include <ktoggleaction.h>
#include <kselectaction.h>
#include <knuminput.h>
#include <kconfig.h>
#include <ksharedconfig.h>
/**
* The base class for Kmag application windows. It sets up the main
......@@ -183,12 +184,12 @@ class KmagApp : public KXmlGuiWindow
KSharedConfigPtr config;
// KAction pointers to enable/disable actions
KAction *fileNewWindow, *m_pSnapshot, *m_pCopy, *m_keyConf, *m_toolConf;
QAction *fileNewWindow, *m_pSnapshot, *m_pCopy, *m_keyConf, *m_toolConf;
QAction *m_pPrint;
QAction *m_pZoomIn;
QAction *m_pZoomOut;
QAction *m_pQuit;
KAction *refreshSwitch;
QAction *refreshSwitch;
KToggleAction *m_pShowMenu;
KSelectAction *m_pZoomBox, *m_pRotationBox, *m_pFPSBox, *m_pColorBox;
......
......@@ -20,13 +20,13 @@
#include "kmagselrect.h"
#include "kmagselrect.moc"
#include <QtGui/QApplication>
#include <QtGui/QCursor>
#include <QtGui/QPixmap>
#include <QtGui/QBitmap>
#include <QtGui/QMouseEvent>
#include <QtGui/QLabel>
#include <QtGui/QDesktopWidget>
#include <QApplication>
#include <QCursor>
#include <QPixmap>
#include <QBitmap>
#include <QMouseEvent>
#include <QLabel>
#include <QDesktopWidget>
#include <klocale.h>
......
......@@ -23,10 +23,10 @@
#include <stdlib.h>
// Qt includes
#include <QtCore/QRect>
#include <QtGui/QWidget>
#include <QtGui/QLabel>
#include <QtGui/QMouseEvent>
#include <QRect>
#include <QWidget>
#include <QLabel>
#include <QMouseEvent>
class KMagSelWinCorner : public QLabel
{
......
......@@ -28,21 +28,20 @@
#include "colorsim.h"
// include files for Qt
#include <QtGui/QBitmap>
#include <QtGui/QCursor>
#include <QtCore/qglobal.h>
#include <QtGui/QPainter>
#include <QtGui/QWidget>
#include <QtGui/QScrollBar>
#include <QtGui/QPixmap>
#include <QtGui/QFocusEvent>
#include <QtGui/QHideEvent>
#include <QtGui/QKeyEvent>
#include <QtGui/QShowEvent>
#include <QtGui/QResizeEvent>
#include <QtGui/QMouseEvent>
#include <QtGui/QDesktopWidget>
#include <QtDBus/QDBusConnection>
#include <QBitmap>
#include <QCursor>
#include <QPainter>
#include <QWidget>
#include <QScrollBar>
#include <QPixmap>
#include <QFocusEvent>
#include <QHideEvent>
#include <QKeyEvent>
#include <QShowEvent>
#include <QResizeEvent>
#include <QMouseEvent>
#include <QDesktopWidget>
#include <QDBusConnection>
// include files for KDE
#include <kapplication.h>
......
......@@ -25,19 +25,19 @@
#define KMagZoomView_h
// include files for Qt
#include <QtGui/QWidget>
#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtCore/QTimer>
#include <QtGui/QAbstractScrollArea>
#include <QtCore/QRect>
#include <QtGui/QCursor>
#include <QtGui/QFocusEvent>
#include <QtGui/QHideEvent>
#include <QtGui/QKeyEvent>
#include <QtGui/QShowEvent>
#include <QtGui/QResizeEvent>
#include <QtGui/QMouseEvent>
#include <QWidget>
#include <QPainter>
#include <QPixmap>
#include <QTimer>
#include <QAbstractScrollArea>
#include <QRect>
#include <QCursor>
#include <QFocusEvent>
#include <QHideEvent>
#include <QKeyEvent>
#include <QShowEvent>
#include <QResizeEvent>
#include <QMouseEvent>
//class KMagSelRect;
#include "kmagselrect.h"
......
......@@ -16,7 +16,7 @@
***************************************************************************/
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <k4aboutdata.h>
#include <klocale.h>
#include <ktoggleaction.h>
#include <kselectaction.h>
......@@ -36,9 +36,9 @@ KmagApp *kmagapp;
int main(int argc, char *argv[])
{
// about the application
KAboutData *aboutData = new KAboutData("kmag", 0, ki18n("KMagnifier"), KMAG_VERSION,
K4AboutData *aboutData = new K4AboutData("kmag", 0, ki18n("KMagnifier"), KMAG_VERSION,
ki18n("Screen magnifier for the K Desktop Environment (KDE)"),
KAboutData::License_GPL,
K4AboutData::License_GPL,
ki18n("Copyright 2001-2003 Sarang Lakare\nCopyright 2003-2004 Olaf Schmidt\nCopyright 2008 Matthew Woehlke"), KLocalizedString(),
"http://accessibility.kde.org/");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment