Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit b5f69b5e authored by Heiko Becker's avatar Heiko Becker 🎸

Port to QStandardPaths

REVIEW: 129352
parent e0cf7fda
......@@ -23,6 +23,10 @@ find_package(KF5 REQUIRED COMPONENTS
)
include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
configure_file(config-sweeper.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-sweeper.h
)
set(sweeper_SRCS
main.cpp
sweeper.cpp
......
#define KDE_INSTALL_FULL_LIBEXECDIR_KF5 "${KDE_INSTALL_FULL_LIBEXECDIR_KF5}"
......@@ -22,11 +22,8 @@
#include <ktoolinvocation.h>
#include <kconfig.h>
#include <kglobal.h>
#include <krecentdocument.h>
#include <kstandarddirs.h>
#include <kbookmarkmanager.h>
#include <klocale.h>
#include <QtDBus/QtDBus>
#include <qstringlist.h>
......@@ -37,6 +34,8 @@
#include <QLatin1String>
#include <QStandardPaths>
#include "config-sweeper.h"
bool ClearThumbnailsAction::action()
{
// http://freedesktop.org/Standards/Home
......@@ -139,7 +138,7 @@ bool ClearWebCacheAction::action()
{
QStringList lst;
lst << QLatin1String( "--clear-all" );
return QProcess::startDetached(KStandardDirs::findExe(QLatin1String( "kio_http_cache_cleaner" )),lst);
return QProcess::startDetached(QFile::decodeName(KDE_INSTALL_FULL_LIBEXECDIR_KF5 "/kio_http_cache_cleaner"), lst);
}
bool ClearRecentDocumentsAction::action()
......@@ -173,9 +172,11 @@ bool ClearFaviconsAction::action()
QStringList saveTheseFavicons;
KBookmarkManager* konqiBookmarkMgr;
const QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ QLatin1String("/konqueror/bookmarks.xml");
QDir().mkpath(path);
konqiBookmarkMgr =
KBookmarkManager::managerForFile(KStandardDirs::locateLocal("data",
QLatin1String("konqueror/bookmarks.xml")), QLatin1String( "konqueror" ));
KBookmarkManager::managerForFile(path, QStringLiteral("konqueror"));
qDebug() << "saving the favicons that are in konqueror bookmarks" ;
qDebug() << "opened konqueror bookmarks at " << konqiBookmarkMgr->path() ;
......
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