Commit 7f868f51 authored by Jeremy Whiting's avatar Jeremy Whiting

Initial port to frameworks and Qt5.

parent 683ea252
project(sweeper)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
find_package(KDE4)
include( KDE4Defaults )
include_directories(${KDE4_INCLUDES})
cmake_minimum_required(VERSION 2.8.12)
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
# If definitions like -D_GNU_SOURCE are needed for these checks they
# should be added to _KDE4_PLATFORM_DEFINITIONS when it is originally
# defined outside this file. Here we include these definitions in
# CMAKE_REQUIRED_DEFINITIONS so they will be included in the build of
# checks below.
set( CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} )
endif()
project(sweeper)
########### next target ###############
include(FeatureSummary)
find_package(Qt5 REQUIRED COMPONENTS Core DBus Widgets)
find_package(ECM 1.7.0 NO_MODULE REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(ECMAddAppIcon)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
find_package(KF5 REQUIRED COMPONENTS
I18n
Crash
Config
ConfigWidgets
CoreAddons
DocTools
KDELibs4Support
)
include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
set(sweeper_SRCS
main.cpp
......@@ -25,15 +30,21 @@ set(sweeper_SRCS
privacyaction.cpp )
qt4_add_dbus_adaptor( sweeper_SRCS org.kde.sweeper.xml sweeper.h Sweeper)
qt5_add_dbus_adaptor( sweeper_SRCS org.kde.sweeper.xml sweeper.h Sweeper)
kde4_add_app_icon(sweeper_SRCS "${KDE4_INSTALL_DIR}/share/icons/oxygen/*/actions/trash-empty.png")
# file(GLOB ICONS_SRCS "${KDE4_INSTALL_DIR}/share/icons/oxygen/*/actions/trash-empty.png")
# ecm_add_app_icon(sweeper_SRCS ICONS ${ICONS_SRCS})
kde4_add_ui_files(sweeper_SRCS sweeperdialog.ui )
ki18n_wrap_ui(sweeper_SRCS sweeperdialog.ui )
kde4_add_executable(sweeper ${sweeper_SRCS})
add_executable(sweeper ${sweeper_SRCS})
target_link_libraries(sweeper ${KDE4_KIO_LIBS})
target_link_libraries(sweeper
Qt5::Core
Qt5::DBus
Qt5::Widgets
KF5::KIOCore
KF5::KDELibs4Support)
install(TARGETS sweeper ${INSTALL_TARGETS_DEFAULT_ARGS} )
......
kde4_create_handbook( index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR sweeper)
kdoctools_create_handbook( index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR sweeper)
......@@ -18,16 +18,16 @@
#include "sweeper.h"
#include <kaboutdata.h>
#include <k4aboutdata.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <klocale.h>
int main(int argc, char *argv[])
{
KAboutData aboutData("sweeper", 0, ki18n("Sweeper"), "1.9",
K4AboutData aboutData("sweeper", 0, ki18n("Sweeper"), "1.9",
ki18n("Helps clean unwanted traces the user leaves on the system."),
KAboutData::License_LGPL, ki18n("(c) 2003-2005, Ralf Hoelzer"), KLocalizedString(),
K4AboutData::License_LGPL, ki18n("(c) 2003-2005, Ralf Hoelzer"), KLocalizedString(),
"http://utils.kde.org/projects/sweeper");
aboutData.addAuthor(ki18n("Ralf Hoelzer"), ki18n("Original author"), "ralf@well.com");
......
......@@ -36,6 +36,7 @@
#include <kconfiggroup.h>
#include <QProcess>
#include <QLatin1String>
#include <QStandardPaths>
bool ClearThumbnailsAction::action()
{
......@@ -125,7 +126,7 @@ bool ClearFormCompletionAction::action()
bool status;
// try to delete the file, if it exists
QFile completionFile(KStandardDirs::locateLocal("data", QLatin1String( "khtml/formcompletions" )));
QFile completionFile(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/khtml/formcompletions" ));
(completionFile.exists() ? status = completionFile.remove() : status = true);
if (!status) {
......@@ -155,21 +156,21 @@ bool ClearWebHistoryAction::action()
(void) QDBusConnection::sessionBus().send(message);
// Delete the file
const QString file = KStandardDirs::locateLocal("data", QLatin1String("konqueror/konq_history"));
const QString file = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/konqueror/konq_history");
QFile::remove(file);
const QDBusMessage message2 = QDBusMessage::createSignal(QLatin1String( "/KonqUndoManager" ), QLatin1String( "org.kde.Konqueror.UndoManager" ), QLatin1String( "notifyRemove" ) );
(void) QDBusConnection::sessionBus().send(message2);
// Delete the file
const QString file2 = KStandardDirs::locateLocal("data", QLatin1String("konqueror/closeditems_saved"));
const QString file2 = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/konqueror/closeditems_saved");
QFile::remove(file2);
return true;
}
bool ClearFaviconsAction::action()
{
QDir favIconDir(KGlobal::dirs()->saveLocation( "cache", QLatin1String( "favicons/" ) ));
QDir favIconDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/') + QLatin1String( "favicons/" ));
QStringList saveTheseFavicons;
KBookmarkManager* konqiBookmarkMgr;
......
......@@ -30,6 +30,7 @@
#include <kmessagebox.h>
#include <QtDBus/QtDBus>
#include <kactioncollection.h>
#include <KSharedConfig>
Sweeper::Sweeper(bool automatic)
: KXmlGuiWindow(0)
......
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