Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
user-manager
Commits
da1b8a1e
Commit
da1b8a1e
authored
Jun 26, 2014
by
Vishesh Handa
Browse files
Simple port to frameworks
parent
8d2da0d4
Changes
8
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
da1b8a1e
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
)
src/CMakeLists.txt
View file @
da1b8a1e
...
...
@@ -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
)
qt
4
_add_dbus_interface
(
user_manager_SRCS
qt
5
_add_dbus_interface
(
user_manager_SRCS
lib/org.freedesktop.Accounts.xml
accounts_interface
)
qt
4
_add_dbus_interface
(
user_manager_SRCS
qt
5
_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"
)
qt
4
_add_dbus_interface
(
user_manager_SRCS
qt
5
_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
}
)
...
...
src/accountinfo.cpp
View file @
da1b8a1e
...
...
@@ -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
);
...
...
src/accountinfo.h
View file @
da1b8a1e
...
...
@@ -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
src/createavatarjob.cpp
View file @
da1b8a1e
...
...
@@ -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
();
}
src/lib/accountmodel.cpp
View file @
da1b8a1e
...
...
@@ -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
}
src/lib/modeltest.cpp
View file @
da1b8a1e
...
...
@@ -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
src/usermanager.cpp
View file @
da1b8a1e
...
...
@@ -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
()
,
p
ar
ent
)
:
KCModule
(
parent
,
ar
gs
)
,
m_saveNeeded
(
false
)
,
m_model
(
new
AccountModel
(
this
))
,
m_widget
(
new
AccountInfo
(
m_model
,
this
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment