Commit 088d7b9c authored by Jeremy Whiting's avatar Jeremy Whiting

Port krdc to Qt5/KF5 using Ulo Parri's review as a starting point.

parent c8789dd6
cmake_minimum_required(VERSION 2.8.9)
cmake_minimum_required(VERSION 2.8.12)
project(krdc)
if(NOT INSIDE_KDENETWORK)
message("Not building inside KDENetwork, loading KDE CMake Macros.")
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
set (KDE_APPLICATIONS_VERSION_MAJOR "15")
set (KDE_APPLICATIONS_VERSION_MINOR "12")
set (KDE_APPLICATIONS_VERSION_MICRO "0")
set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
find_package(KF5 REQUIRED COMPONENTS
Config
KCMUtils
DNSSD
NotifyConfig
Notifications
Bookmarks
IconThemes
XmlGui
Completion
Wallet
WidgetsAddons
NotifyConfig
I18n
)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckPrototypeExists)
include(CheckTypeSize)
find_package(KF5 COMPONENTS DocTools)
include(ECMSetupVersion)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
include(FeatureSummary)
# use sane compile flags
add_definitions(
-DQT_USE_QSTRINGBUILDER
-DQT_NO_CAST_TO_ASCII
-DQT_NO_CAST_FROM_ASCII
-DQT_STRICT_ITERATORS
-DQT_NO_URL_CAST_FROM_STRING
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_USE_FAST_OPERATOR_PLUS
)
ecm_setup_version(${KDE_APPLICATIONS_VERSION}
VARIABLE_PREFIX KRDC
SOVERSION 5
VERSION_HEADER krdc_version.h
)
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
if(WIN32)
set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES})
endif(WIN32)
add_definitions(${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
endif(NOT INSIDE_KDENETWORK)
if(WIN32)
set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES})
endif(WIN32)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
macro_optional_find_package(LibVNCServer)
macro_log_feature(LIBVNCSERVER_FOUND "libvncserver" "VNC server / client library" "http://libvncserver.sourceforge.net/" FALSE "0.9.8" "Needed to build VNC client support in KRDC")
FIND_PROGRAM(FREERDP_EXECUTABLE xfreerdp)
if(FREERDP_EXECUTABLE)
set(FREERDP_EXECUTABLE_FOUND true)
endif(FREERDP_EXECUTABLE)
macro_log_feature(FREERDP_EXECUTABLE_FOUND "freerdp" "A free Remote Desktop Protocol (RDP) Implementation" "http://www.freerdp.com" FALSE "1.0.2" "Needed for RDP support in KRDC (at runtime)")
find_package(LibVNCServer)
set_package_properties("libvncserver" PROPERTIES
DESCRIPTION "VNC server / client library"
URL "http://libvncserver.sourceforge.net/"
PURPOSE "Needed to build VNC client support in KRDC"
)
# Needs porting
# FIND_PROGRAM(FREERDP_EXECUTABLE xfreerdp)
# if(FREERDP_EXECUTABLE)
# set(FREERDP_EXECUTABLE_FOUND true)
# endif(FREERDP_EXECUTABLE)
#
# set_package_properties("freerdp" PROPERTIES
# DESCRIPTION "A free Remote Desktop Protocol (RDP) Implementation"
# URL "http://www.freerdp.com"
# PURPOSE "Needed for RDP support in KRDC (at runtime)"
# )
# NX support is not ready for KDE 4.2; disabled (uwolfer)
# macro_optional_find_package(LibNXCL)
# macro_log_feature(LIBNXCL_FOUND "libnxcl" "NX X compression client library" "http://svn.berlios.de/svnroot/repos/freenx/trunk/freenx-client/nxcl/" FALSE "1.0" "Needed to build Krdc with NX support")
macro_optional_find_package(TelepathyQt4)
macro_log_feature(TelepathyQt4_FOUND "telepathy-qt" "Telepathy Qt Bindings" "http://telepathy.freedesktop.org" FALSE "0.9" "Needed to build Telepathy Tubes support.")
find_package(TelepathyQt5)
set_package_properties("telepathy-qt" PROPERTIES
DESCRIPTION "Telepathy Qt Bindings"
URL "http://telepathy.freedesktop.org"
PURPOSE "Needed to build Telepathy Tubes support.")
if(TelepathyQt4_FOUND)
if(TelepathyQt5_FOUND)
add_definitions(-DTELEPATHY_SUPPORT)
include_directories(${TELEPATHY_QT4_INCLUDE_DIR})
endif()
include_directories(
......@@ -62,18 +104,19 @@ add_subdirectory(vnc)
add_subdirectory(nx)
add_subdirectory(rdp)
add_subdirectory(test)
add_subdirectory(doc)
if(TelepathyQt4_FOUND)
add_subdirectory(krdc_approver)
if(KF5DocTools_FOUND)
add_subdirectory(doc)
else()
message("KF5DocTools not found. Not building documentation.")
endif()
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5010)
add_definitions(-DBUILD_ZEROCONF)
set(krdc_SRCS
config/hostpreferenceslist.cpp
config/preferencesdialog.cpp
core/logging.cpp
floatingtoolbar.cpp
bookmarkmanager.cpp
connectiondelegate.cpp
......@@ -84,42 +127,46 @@ set(krdc_SRCS
main.cpp
)
if(TelepathyQt4_FOUND)
if(TelepathyQt5_FOUND)
add_subdirectory(krdc_approver)
set(krdc_SRCS ${krdc_SRCS}
tubesmanager.cpp
)
endif()
kde4_add_ui_files(krdc_SRCS
ki18n_wrap_ui(krdc_SRCS
config/general.ui
)
kde4_add_app_icon(krdc_SRCS "${KDE4_INSTALL_DIR}/share/icons/oxygen/*/apps/krdc.png")
kde4_add_executable(krdc ${krdc_SRCS})
add_executable(krdc ${krdc_SRCS})
target_link_libraries(krdc
${KDE4_KFILE_LIBS}
${KDE4_KIO_LIBS}
${KDE4_KNOTIFYCONFIG_LIBS}
${KDE4_KCMUTILS_LIBS}
KF5::ConfigCore
KF5::KCMUtils
KF5::DNSSD
KF5::NotifyConfig
KF5::Bookmarks
KF5::IconThemes
KF5::XmlGui
KF5::Completion
KF5::WidgetsAddons
KF5::NotifyConfig
KF5::Notifications
krdccore
)
if(TelepathyQt4_FOUND)
if(TelepathyQt5_FOUND)
target_link_libraries(krdc
${TELEPATHY_QT4_LIBRARIES}
${TELEPATHY_QT5_LIBRARIES}
)
endif()
target_link_libraries(krdc ${KDE4_KDNSSD_LIBS})
install(TARGETS krdc ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES krdcui.rc DESTINATION ${DATA_INSTALL_DIR}/krdc)
install(PROGRAMS krdc.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES krdcui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/krdc)
install(PROGRAMS org.kde.krdc.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES pointcursor.png pointcursormask.png DESTINATION ${DATA_INSTALL_DIR}/krdc/pics)
if(TelepathyQt4_FOUND)
if(TelepathyQt5_FOUND)
configure_file(org.freedesktop.Telepathy.Client.krdc_rfb_handler.service.in
${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.krdc_rfb_handler.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.krdc_rfb_handler.service
......@@ -128,6 +175,4 @@ if(TelepathyQt4_FOUND)
install(FILES krdc_rfb_handler.client DESTINATION ${SHARE_INSTALL_PREFIX}/telepathy/clients/)
endif()
if(NOT INSIDE_KDENETWORK)
macro_display_feature_log()
endif(NOT INSIDE_KDENETWORK)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -22,36 +22,38 @@
****************************************************************************/
#include "bookmarkmanager.h"
#include "mainwindow.h"
#include "logging.h"
#include <KBookmarks/KBookmarkOwner>
#include <KI18n/KLocalizedString>
#include <KBookmarkMenu>
#include <KStandardDirs>
#include <KDebug>
#include <QStandardPaths>
BookmarkManager::BookmarkManager(KActionCollection *collection, KMenu *menu, MainWindow *parent)
BookmarkManager::BookmarkManager(KActionCollection *collection, QMenu *menu, MainWindow *parent)
: QObject(parent),
KBookmarkOwner(),
m_mainWindow(parent)
{
const QString file = KStandardDirs::locateLocal("data", "krdc/bookmarks.xml");
m_manager = KBookmarkManager::managerForFile(file, "krdc");
const QString dir = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString(),
QStandardPaths::LocateOption::LocateDirectory);
const QString file = dir + QLatin1String("/krdc/bookmarks.xml");
m_manager = KBookmarkManager::managerForFile(file, QLatin1String("krdc"));
m_manager->setUpdate(true);
m_bookmarkMenu = new KBookmarkMenu(m_manager, this, menu, collection);
KBookmarkGroup root = m_manager->root();
KBookmark bm = root.first();
while (!bm.isNull()) {
if (bm.metaDataItem("krdc-history") == "historyfolder") // get it also when user renamed it
if (bm.metaDataItem(QLatin1String("krdc-history")) == QLatin1String("historyfolder")) // get it also when user renamed it
break;
bm = root.next(bm);
}
if (bm.isNull()) {
kDebug(5010) << "History folder not found. Create it.";
qCDebug(KRDC) << "History folder not found. Create it.";
bm = m_manager->root().createNewFolder(i18n("History"));
bm.setMetaDataItem("krdc-history", "historyfolder");
bm.setMetaDataItem(QStringLiteral("krdc-history"), QStringLiteral("historyfolder"));
m_manager->emitChanged();
}
......@@ -67,10 +69,10 @@ void BookmarkManager::addHistoryBookmark(RemoteView *view)
{
KBookmark bm = m_historyGroup.first();
const QString urlString = urlForView(view);
const KUrl url = KUrl(urlString);
const QUrl url = QUrl(urlString);
while (!bm.isNull()) {
if (bm.url() == url) {
kDebug(5010) << "Found URL. Move it at the history start.";
qCDebug(KRDC) << "Found URL. Move it at the history start.";
m_historyGroup.moveBookmark(bm, KBookmark());
bm.updateAccessMetadata();
m_manager->emitChanged(m_historyGroup);
......@@ -80,8 +82,8 @@ void BookmarkManager::addHistoryBookmark(RemoteView *view)
}
if (bm.isNull()) {
kDebug(5010) << "Add new history bookmark.";
bm = m_historyGroup.addBookmark(titleForUrl(urlString), urlString);
qCDebug(KRDC) << "Add new history bookmark.";
bm = m_historyGroup.addBookmark(titleForUrl(url), url, QString());
bm.updateAccessMetadata();
m_historyGroup.moveBookmark(bm, KBookmark());
m_manager->emitChanged(m_historyGroup);
......@@ -112,19 +114,18 @@ bool BookmarkManager::editBookmarkEntry() const
return true;
}
QString BookmarkManager::currentUrl() const
QUrl BookmarkManager::currentUrl() const
{
RemoteView *view = m_mainWindow->currentRemoteView();
if (view)
return urlForView(view);
return QUrl(urlForView(view));
else
return QString();
return QUrl();
}
QString BookmarkManager::urlForView(RemoteView *view) const
{
return view->url().prettyUrl(KUrl::RemoveTrailingSlash);
return view->url().toDisplayString(QUrl::UrlFormattingOption::StripTrailingSlash);
}
QString BookmarkManager::currentTitle() const
......@@ -132,10 +133,9 @@ QString BookmarkManager::currentTitle() const
return titleForUrl(currentUrl());
}
QString BookmarkManager::titleForUrl(const QString &url) const
QString BookmarkManager::titleForUrl(const QUrl &url) const
{
return QUrl::fromPercentEncoding(url.toUtf8());
return url.toDisplayString(QUrl::UrlFormattingOption::StripTrailingSlash);
}
bool BookmarkManager::supportsTabs() const
......@@ -143,24 +143,26 @@ bool BookmarkManager::supportsTabs() const
return true;
}
QList<QPair<QString, QString> > BookmarkManager::currentBookmarkList() const
QList<KBookmarkOwner::FutureBookmark> BookmarkManager::currentBookmarkList() const
{
QList<QPair<QString, QString> > list;
QList<KBookmarkOwner::FutureBookmark> list;
QMapIterator<QWidget *, RemoteView *> iter(m_mainWindow->remoteViewList());
while (iter.hasNext()) {
RemoteView *next = iter.next().value();
const QString url = next->url().prettyUrl(KUrl::RemoveTrailingSlash);
list << QPair<QString, QString>(url, url);
const QUrl url = next->url();
const QString title = titleForUrl(url);
KBookmarkOwner::FutureBookmark bookmark = KBookmarkOwner::FutureBookmark(title, url, QString());
list.append(bookmark);
}
return list;
}
void BookmarkManager::addManualBookmark(const QString &url, const QString &text)
void BookmarkManager::addManualBookmark(const QUrl &url, const QString &text)
{
m_manager->root().addBookmark(url, text);
m_manager->root().addBookmark(text, url, QString());
emit m_manager->emitChanged();
}
......@@ -178,7 +180,7 @@ const QStringList BookmarkManager::findBookmarkAddresses(const KBookmarkGroup &g
bookmarkAddresses.append(findBookmarkAddresses(bm.toGroup(), url));
}
if (bm.url() == url) {
if (bm.url() == QUrl::fromLocalFile(url)) {
bookmarkAddresses.append(bm.address());
}
bm = group.next(bm);
......@@ -190,14 +192,14 @@ void BookmarkManager::removeByUrl(KBookmarkManager *manager, const QString &url,
{
foreach(const QString &address, findBookmarkAddresses(manager->root(), url)) {
KBookmark bm = manager->findByAddress(address);
if (ignoreHistory && bm.parentGroup().metaDataItem("krdc-history") == "historyfolder") {
if (ignoreHistory && bm.parentGroup().metaDataItem(QLatin1String("krdc-history")) == QLatin1String("historyfolder")) {
if (!updateTitle.isEmpty()) {
kDebug(5010) << "Update" << bm.fullText();
qCDebug(KRDC) << "Update" << bm.fullText();
bm.setFullText(updateTitle);
}
} else {
if (!bm.isGroup()) { // please don't delete groups... happened in testing
kDebug(5010) << "Delete" << bm.fullText();
qCDebug(KRDC) << "Delete" << bm.fullText();
bm.parentGroup().deleteBookmark(bm);
}
}
......@@ -211,9 +213,9 @@ void BookmarkManager::updateTitle(KBookmarkManager *manager, const QString &url,
foreach(const QString &address, findBookmarkAddresses(manager->root(), url)) {
KBookmark bm = manager->findByAddress(address);
bm.setFullText(title);
kDebug(5010) << "Update" << bm.fullText();
qCDebug(KRDC) << "Update" << bm.fullText();
}
manager->emitChanged();
}
#include "bookmarkmanager.moc"
......@@ -27,9 +27,10 @@
#include "core/remoteview.h"
#include <KBookmarkManager>
#include <KXmlGui/KActionCollection>
#include <KBookmarks/KBookmarkMenu>
class KActionCollection;
class KBookmarkMenu;
#include <QMenu>
class MainWindow;
......@@ -38,17 +39,17 @@ class BookmarkManager : public QObject, public KBookmarkOwner
Q_OBJECT
public:
BookmarkManager(KActionCollection *collection, KMenu *menu, MainWindow *parent);
BookmarkManager(KActionCollection *collection, QMenu *menu, MainWindow *parent);
~BookmarkManager();
virtual QString currentUrl() const;
virtual QString currentTitle() const;
virtual QUrl currentUrl() const Q_DECL_OVERRIDE;
virtual QString currentTitle() const Q_DECL_OVERRIDE;
virtual bool addBookmarkEntry() const;
virtual bool editBookmarkEntry() const;
virtual bool supportsTabs() const;
virtual QList<QPair<QString, QString> > currentBookmarkList() const;
virtual bool supportsTabs() const Q_DECL_OVERRIDE;
virtual QList<KBookmarkOwner::FutureBookmark> currentBookmarkList() const Q_DECL_OVERRIDE;
void addHistoryBookmark(RemoteView *view);
void addManualBookmark(const QString &url, const QString &text);
void addManualBookmark(const QUrl &url, const QString &text);
KBookmarkManager* getManager();
// removes all bookmarks with url, possibly ignore the history folder and update it's title there if it's set
static void removeByUrl(KBookmarkManager *manager, const QString &url, bool ignoreHistory = false, const QString updateTitle = QString());
......@@ -56,16 +57,16 @@ public:
// returns a QStringList for all bookmarks that point to this url using KBookmark::address()
static const QStringList findBookmarkAddresses(const KBookmarkGroup &group, const QString &url);
signals:
void openUrl(const KUrl &url);
Q_SIGNALS:
void openUrl(const QUrl &url);
private slots:
private Q_SLOTS:
void openBookmark(const KBookmark &bm, Qt::MouseButtons, Qt::KeyboardModifiers);
void openFolderinTabs(const KBookmarkGroup &bookmarkGroup);
private:
QString urlForView(RemoteView *view) const;
QString titleForUrl(const QString &url) const;
QString titleForUrl(const QUrl &url) const;
KBookmarkMenu *m_bookmarkMenu;
KBookmarkManager *m_manager;
......
......@@ -6,8 +6,6 @@
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
INCLUDE(CheckPointerMember)
IF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
# Already in cache, be silent
SET(LIBVNCSERVER_FIND_QUIETLY TRUE)
......@@ -25,7 +23,17 @@ FIND_LIBRARY(LIBVNCCLIENT_LIBRARIES NAMES vncclient libvncclient)
IF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
SET(CMAKE_REQUIRED_INCLUDES "${LIBVNCSERVER_INCLUDE_DIR}" "${CMAKE_REQUIRED_INCLUDES}")
CHECK_POINTER_MEMBER(rfbClient* GotXCutText rfb/rfbclient.h LIBVNCSERVER_FOUND)
SET(_TEST_SOURCE_CODE "
#include <rfb/rfbclient.h>
int main()
{
rfbClient* tmp;
tmp->GotXCutText;
return 0;
}
")
CHECK_CXX_SOURCE_COMPILES("${_TEST_SOURCE_CODE}" LIBVNCSERVER_FOUND)
ENDIF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
IF (LIBVNCSERVER_FOUND)
......
......@@ -23,13 +23,11 @@
#include "hostpreferenceslist.h"
#include "hostpreferences.h"
#include "logging.h"
#include <KDebug>
#include <KIcon>
#include <KLocale>
#include <KMessageBox>
#include <KPushButton>
#include <KStandardDirs>
#include <QIcon>
#include <KI18n/KLocalizedString>
#include <KWidgetsAddons/KMessageBox>
#include <QFile>
#include <QLayout>
......@@ -44,16 +42,16 @@ HostPreferencesList::HostPreferencesList(QWidget *parent, MainWindow *mainWindow
connect(hostList, SIGNAL(itemSelectionChanged()), SLOT(selectionChanged()));
connect(hostList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), SLOT(configureHost()));
configureButton = new KPushButton(this);
configureButton = new QPushButton(this);
configureButton->setEnabled(false);
configureButton->setText(i18n("Configure..."));
configureButton->setIcon(KIcon("configure"));
configureButton->setIcon(QIcon::fromTheme(QLatin1String("configure")));
connect(configureButton, SIGNAL(clicked()), SLOT(configureHost()));
removeButton = new KPushButton(this);
removeButton = new QPushButton(this);
removeButton->setEnabled(false);
removeButton->setText(i18n("Remove"));
removeButton->setIcon(KIcon("list-remove"));
removeButton->setIcon(QIcon::fromTheme(QLatin1String("list-remove")));
connect(removeButton, SIGNAL(clicked()), SLOT(removeHost()));
QVBoxLayout *buttonLayout = new QVBoxLayout;
......@@ -77,8 +75,8 @@ HostPreferencesList::~HostPreferencesList()
void HostPreferencesList::readConfig()
{
QStringList urls = m_hostPrefsConfig.groupList();
for (int i = 0; i < urls.size(); ++i)
for (int i = 0; i < urls.size(); ++i)
hostList->addItem(new QListWidgetItem(urls.at(i)));
}
......@@ -92,20 +90,21 @@ void HostPreferencesList::configureHost()
QList<QListWidgetItem *> selectedItems = hostList->selectedItems();
foreach(QListWidgetItem *selectedItem, selectedItems) {
const QString url = selectedItem->text();
const QString urlString = selectedItem->text();
const QUrl url = QUrl(urlString);
kDebug(5010) << "Configure host: " << url;
qCDebug(KRDC) << "Configure host: " << urlString;
HostPreferences* prefs = 0;
const QList<RemoteViewFactory *> remoteViewFactories(m_mainWindow->remoteViewFactoriesList());
foreach(RemoteViewFactory *factory, remoteViewFactories) {
if (factory->supportsUrl(url)) {
prefs = factory->createHostPreferences(m_hostPrefsConfig.group(url), this);
prefs = factory->createHostPreferences(m_hostPrefsConfig.group(urlString), this);
if (prefs) {
kDebug(5010) << "Found plugin to handle url (" + url + "): " + prefs->metaObject()->className();
qCDebug(KRDC) << "Found plugin to handle url (" << urlString << "): " << prefs->metaObject()->className();
} else {
kDebug(5010) << "Found plugin to handle url (" + url + "), but plugin does not provide preferences";
qCDebug(KRDC) << "Found plugin to handle url (" << urlString << "), but plugin does not provide preferences";
}
}
}
......@@ -126,7 +125,7 @@ void HostPreferencesList::removeHost()
const QList<QListWidgetItem *> selectedItems = hostList->selectedItems();
foreach(QListWidgetItem *selectedItem, selectedItems) {
kDebug(5010) << "Remove host: " << selectedItem->text();
qCDebug(KRDC) << "Remove host: " << selectedItem->text();
m_hostPrefsConfig.deleteGroup(selectedItem->text());
delete(selectedItem);
......@@ -144,4 +143,3 @@ void HostPreferencesList::selectionChanged()
removeButton->setEnabled(enabled);
}
#include "hostpreferenceslist.moc"
......@@ -26,12 +26,11 @@
#include "mainwindow.h"
#include <KConfigGroup>
#include <KConfigCore/KConfigGroup>
#include <QDomDocument>
#include <QWidget>
class KPushButton;
#include <QPushButton>
class QListWidget;
......@@ -43,7 +42,7 @@ public:
HostPreferencesList(QWidget *parent, MainWindow *mainWindow, KConfigGroup hostPrefsConfig);
~HostPreferencesList();
private slots:
private Q_SLOTS:
void readConfig();
void saveSettings();
void configureHost();
......@@ -53,8 +52,8 @@ private slots:
private:
KConfigGroup m_hostPrefsConfig;
KPushButton *configureButton;
KPushButton *removeButton;
QPushButton *configureButton;
QPushButton *removeButton;
QListWidget *hostList;
MainWindow *m_mainWindow;
};
......
......@@ -22,40 +22,40 @@
****************************************************************************/
#include "preferencesdialog.h"
#include "logging.h"
#include "hostpreferenceslist.h"
#include "ui_general.h"
#include <KConfigSkeleton>
#include <KDebug>
#include <KPluginSelector>