Commit da1b8a1e authored by Vishesh Handa's avatar Vishesh Handa
Browse files

Simple port to frameworks

parent 8d2da0d4
project(user-manager)
cmake_minimum_required(VERSION 2.8.12)
find_package(ECM 0.0.9 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
find_package(KDE4 REQUIRED)
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Widgets)
find_package(KF5 REQUIRED COMPONENTS KDELibs4Support)
find_package(PWQuality REQUIRED)
include(KDE4Defaults)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include_directories(${KDE4_INCLUDES} ${QT_INCLUDES} ${PWQUALITY_INCLUDE_DIR})
include_directories(${PWQUALITY_INCLUDE_DIR})
add_subdirectory(src)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -15,29 +15,33 @@ set_source_files_properties(lib/org.freedesktop.Accounts.xml
set_source_files_properties(lib/org.freedesktop.Accounts.User.xml
PROPERTIES NO_NAMESPACE TRUE)
qt4_add_dbus_interface(user_manager_SRCS
qt5_add_dbus_interface(user_manager_SRCS
lib/org.freedesktop.Accounts.xml
accounts_interface
)
qt4_add_dbus_interface(user_manager_SRCS
qt5_add_dbus_interface(user_manager_SRCS
lib/org.freedesktop.Accounts.User.xml
user_interface
)
set(login1_manager_xml lib/org.freedesktop.login1.Manager.xml)
set_source_files_properties(${login1_manager_xml} PROPERTIES INCLUDE "lib/usersessions.h")
qt4_add_dbus_interface(user_manager_SRCS
qt5_add_dbus_interface(user_manager_SRCS
${login1_manager_xml}
login1_interface
)
kde4_add_ui_files(user_manager_SRCS kcm.ui account.ui password.ui)
qt5_wrap_ui(user_manager_SRCS kcm.ui account.ui password.ui)
kde4_add_plugin(user_manager ${user_manager_SRCS})
add_library(user_manager MODULE ${user_manager_SRCS})
target_link_libraries(user_manager ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${PWQUALITY_LIBRARY} crypt)
target_link_libraries(user_manager
KF5::KDELibs4Support
${PWQUALITY_LIBRARY}
crypt
)
install(TARGETS user_manager DESTINATION ${PLUGIN_INSTALL_DIR})
......
......@@ -26,9 +26,9 @@
#include <pwd.h>
#include <utmp.h>
#include <QtGui/QMenu>
#include <QtGui/QToolButton>
#include <QtGui/QDesktopServices>
#include <QMenu>
#include <QToolButton>
#include <QDesktopServices>
#include <KDebug>
#include <KImageIO>
......@@ -39,6 +39,7 @@
#include <kio/copyjob.h>
#include <KTemporaryFile>
#include <KGlobalSettings>
#include <KIconLoader>
#define MAX_USER_LEN (UT_NAMESIZE - 1)
......@@ -375,7 +376,8 @@ void AccountInfo::openAvatarSlot()
KFileDialog dlg(QDir::homePath(), KImageIO::pattern(KImageIO::Reading), this);
dlg.setOperationMode(KFileDialog::Opening);
dlg.setCaption(i18nc("@title:window", "Choose Image"));
#warning KFileDialog::setCaption is missing
//dlg.setCaption(i18nc("@title:window", "Choose Image"));
dlg.setMode(KFile::File);
KImageFilePreview *imagePreviewer = new KImageFilePreview(&dlg);
......
......@@ -21,7 +21,7 @@
#include <QtCore/QModelIndex>
#include <QtGui/QWidget>
#include <QWidget>
#include "lib/accountmodel.h"
class KJob;
......@@ -72,4 +72,4 @@ class AccountInfo : public QWidget
QMap<AccountModel::Role, QVariant> m_infoToSave;
};
#endif //ACCOUNT_INFO_WIDGET
\ No newline at end of file
#endif //ACCOUNT_INFO_WIDGET
......@@ -18,6 +18,7 @@
#include "createavatarjob.h"
#include <QImage>
#include <KDebug>
#include <kio/copyjob.h>
#include <KTemporaryFile>
......@@ -67,7 +68,8 @@ void CreateAvatarJob::copyDone(KJob* job)
return;
}
QImage face = KPixmapRegionSelectorDialog::getSelectedImage(QPixmap(m_tmpFile), 192, 192);
#warning KPixmapRegionSelectorDialog is no longer available
QImage face; // = KPixmapRegionSelectorDialog::getSelectedImage(QPixmap(m_tmpFile), 192, 192);
face.save(m_tmpFile, "PNG", 10);
emitResult();
}
......@@ -23,7 +23,7 @@
#include "accounts_interface.h"
#include "user_interface.h"
#include <QtGui/QIcon>
#include <QIcon>
#include <KDebug>
#include <KLocalizedString>
......@@ -467,4 +467,4 @@ QDebug operator<<(QDebug debug, AccountModel::Role role)
break;
}
return debug;
}
\ No newline at end of file
}
......@@ -23,7 +23,7 @@
#include "modeltest.h"
#include <QtGui/QtGui>
#include <QtGui>
/*!
* Connect to all of the models signals. Whenever anything happens recheck everything.
......@@ -519,4 +519,4 @@ void ModelTest::checkChildren(const QModelIndex &parent, int currentDepth)
Q_ASSERT(c.next == model->data(model->index(start, 0, c.parent)));
}
\ No newline at end of file
......@@ -27,18 +27,19 @@
#include <pwquality.h>
#include <QtCore/QDebug>
#include <QtGui/QListView>
#include <QtGui/QVBoxLayout>
#include <QListView>
#include <QVBoxLayout>
#include <kpluginfactory.h>
#include <KLocalizedString>
#include <KMessageBox>
#include <KIconLoader>
K_PLUGIN_FACTORY(UserManagerFactory, registerPlugin<UserManager>();)
K_EXPORT_PLUGIN(UserManagerFactory("user_manager", "user_manager"))
UserManager::UserManager(QWidget* parent, const QVariantList& args)
: KCModule(UserManagerFactory::componentData(), parent)
: KCModule(parent, args)
, m_saveNeeded(false)
, m_model(new AccountModel(this))
, m_widget(new AccountInfo(m_model, this))
......
Supports Markdown
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