summarylogtreecommitdiffstats
path: root/port_to_kf5.patch
blob: 393ea8d9ef71a43a2f0c3c55cf7848c18409d472 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
diff -Naur kuser-16.08.3/CMakeLists.txt kuser-16.08.3.new/CMakeLists.txt
--- kuser-16.08.3/CMakeLists.txt	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/CMakeLists.txt	2017-01-16 21:13:11.000000000 +0800
@@ -2,18 +2,35 @@
 project(kuser)
 
 # search packages used by KDE
-find_package(KDE4 REQUIRED)
-include (KDE4Defaults)
+find_package(ECM 0.0.11 REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
+
+if(COMMAND cmake_policy)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND cmake_policy)
+
+
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDECompilerSettings)
+include(FeatureSummary)
+
+find_package(Qt5 REQUIRED COMPONENTS Widgets)
+find_package(KF5 REQUIRED COMPONENTS KDELibs4Support KIO Ldap)
+
+
 include (MacroLibrary)
 
-add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
+include(CheckIncludeFiles)
+
+#add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
 add_definitions( -DQT_NO_CAST_FROM_ASCII )
 add_definitions( -DQT_NO_CAST_TO_ASCII )
 add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
 
 include_directories (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
 
-find_package(KdepimLibs REQUIRED)
+#find_package(KdepimLibs REQUIRED)
 
 include(CheckFunctionExists)
 include(CheckIncludeFiles)
@@ -27,7 +44,7 @@
 add_subdirectory(doc)
 
 # use the project-specific _SOURCE_DIR variable (set by the project() call above), Alex
-include_directories(${kuser_SOURCE_DIR} ${KDEPIMLIBS_INCLUDE_DIR})
+include_directories(${kuser_SOURCE_DIR})
 
 set(KU_HOMEDIR_PERM 0700 CACHE STRING "Default home directory permissions")
 set(KU_MAILBOX_GID 0 CACHE STRING "Default GID of the created mbox file")
@@ -88,7 +105,7 @@
 
 kde4_add_executable(kuser ${kuser_SRCS})
 
-target_link_libraries(kuser ${KDE4_KIO_LIBS} ${KDE4_KLDAP_LIBS} ${KDE4_TARGET_PREFIX}kntlm)
+target_link_libraries(kuser KF5::KDELibs4Support KF5::KIONTLM KF5::Ldap)
 if(HAVE_CRYPT_LIBRARY)
 	target_link_libraries(kuser crypt)
 endif(HAVE_CRYPT_LIBRARY)
diff -Naur kuser-16.08.3/ku_adduser.cpp kuser-16.08.3.new/ku_adduser.cpp
--- kuser-16.08.3/ku_adduser.cpp	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_adduser.cpp	2017-01-16 21:13:11.000000000 +0800
@@ -46,9 +46,10 @@
   QGroupBox *group = new QGroupBox(frontpage);
   group->setTitle(i18n("New Account Options"));
   QVBoxLayout *grouplayout = new QVBoxLayout( group );
-  grouplayout->setMargin( marginHint() );
-  grouplayout->setSpacing( spacingHint() );
-//  grouplayout->addSpacing( group->fontMetrics().lineSpacing() );
+  //TO BE FIXED
+  //grouplayout->setMargin( marginHint() );
+  //grouplayout->setSpacing( spacingHint() );
+  grouplayout->addSpacing( group->fontMetrics().lineSpacing() );
 
   createhome = new QCheckBox(i18n("Create home folder"), 0);
   createhome->setChecked(true);
diff -Naur kuser-16.08.3/ku_configdlg.cpp kuser-16.08.3.new/ku_configdlg.cpp
--- kuser-16.08.3/ku_configdlg.cpp	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_configdlg.cpp	2017-01-16 21:13:11.000000000 +0800
@@ -40,12 +40,12 @@
 #include "ui_ku_ldapsamba.h"
 #include "ui_ku_passwordpolicy.h"
 
-KU_ConfigDlg::KU_ConfigDlg( KConfigSkeleton *config, QWidget *parent, const char *name ) :
+KU_ConfigDlg::KU_ConfigDlg( KCoreConfigSkeleton *config, QWidget *parent, const char *name ) :
     KConfigDialog( parent, QLatin1String( name ), config),sambaui(0)
 {
   setFaceType(List);
-  setButtons(Default|Ok|Apply|Cancel|Help);
-  setDefaultButton(Ok);
+  setStandardButtons(QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::Help );
+  //setDefaultButton(Ok);
   setModal(true);
   KTabWidget *page1 = new KTabWidget( this );
   {
@@ -142,7 +142,7 @@
   _url.setExtension( QLatin1String( "x-dir" ), QLatin1String( "base" ) );
   _url.setFilter( filter );
 
-  kDebug() << "sendQuery url: " << _url.prettyUrl();
+  //kDebug() << "sendQuery url: " << _url.prettyUrl();
   mLdif.startParsing();
   KIO::Job *job = KIO::get( _url, KIO::Reload, KIO::HideProgressInfo );
 //  job->addMetaData("no-auth-prompt","true");
@@ -152,7 +152,7 @@
     this, SLOT(loadResult(KJob*)) );
 
   mProg = new QProgressDialog( 0 );
-  mProg->setLabel( new QLabel(_url.prettyUrl()) );
+  mProg->setLabel( new QLabel(_url.toDisplayString()) );
   mProg->setValue( 0 );
   mProg->setMaximum( 1 );
   mProg->setAutoClose( false );
diff -Naur kuser-16.08.3/ku_configdlg.h kuser-16.08.3.new/ku_configdlg.h
--- kuser-16.08.3/ku_configdlg.h	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_configdlg.h	2017-01-16 21:13:11.000000000 +0800
@@ -44,7 +44,7 @@
 class KU_ConfigDlg : public KConfigDialog {
   Q_OBJECT
 public:
-  KU_ConfigDlg( KConfigSkeleton *config, QWidget* parent, const char * name = 0 );
+  KU_ConfigDlg( KCoreConfigSkeleton *config, QWidget* parent, const char * name = 0 );
   ~KU_ConfigDlg();
 private:
   QProgressDialog *mProg;
diff -Naur kuser-16.08.3/ku_edituser.cpp kuser-16.08.3.new/ku_edituser.cpp
--- kuser-16.08.3/ku_edituser.cpp	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_edituser.cpp	2017-01-16 21:13:11.000000000 +0800
@@ -349,13 +349,13 @@
   KPageDialog( parent)
 
 {
-  setCaption(i18n("User Properties"));
-  setButtons( Ok | Cancel);
-  setDefaultButton(Ok);
+  setWindowTitle(i18n("User Properties"));
+  setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+  //setDefaultButton(QDialogButtonBox::Ok);
   setFaceType(KPageDialog::Tabbed);
   mSelected = selected;
   if ( mSelected.count() > 1 )
-    setCaption( i18n("User Properties - %1 Selected Users", mSelected.count() ) );
+    setWindowTitle( i18n("User Properties - %1 Selected Users", mSelected.count() ) );
   else {
     mUser = KU_Global::users()->at( selected[0] );
     mSelected.clear();
@@ -372,9 +372,9 @@
   KPageDialog(parent)
 
 {
-  setCaption(i18n("User Properties"));
-  setButtons(Ok | Cancel);
-  setDefaultButton( Ok);
+  setWindowTitle(i18n("User Properties"));
+  setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+  //setDefaultButton(QDialogButtonBox::Ok);
   setModal(true);
   setFaceType(KPageDialog::Tabbed);
 
diff -Naur kuser-16.08.3/ku_global.cpp kuser-16.08.3.new/ku_global.cpp
--- kuser-16.08.3/ku_global.cpp	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_global.cpp	2017-01-16 21:13:11.000000000 +0800
@@ -63,7 +63,7 @@
   delete mGroups;
 
   SID::setAlgRidBase( mCfg->samridbase() );
-  kDebug() << "Algorithmic RID base: " << SID::getAlgRidBase();
+  //qCDebug() << "Algorithmic RID base: " << SID::getAlgRidBase();
   switch ( mCfg->source() ) {
     case KU_PrefsBase::EnumSource::Files:
       mUsers = new KU_UserFiles( mCfg );
diff -Naur kuser-16.08.3/ku_global.h kuser-16.08.3.new/ku_global.h
--- kuser-16.08.3/ku_global.h	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_global.h	2017-01-16 21:13:11.000000000 +0800
@@ -24,6 +24,7 @@
 
 #include "ku_user.h"
 #include "ku_group.h"
+#include <QLoggingCategory>
 
 class KU_Global {
 public:
diff -Naur kuser-16.08.3/ku_groupldap.cpp kuser-16.08.3.new/ku_groupldap.cpp
--- kuser-16.08.3/ku_groupldap.cpp	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_groupldap.cpp	2017-01-16 21:13:11.000000000 +0800
@@ -29,16 +29,16 @@
 KU_GroupLDAP::KU_GroupLDAP( KU_PrefsBase *cfg ) : KU_Groups( cfg )
 {
   if ( mCfg->ldapssl() )
-    mUrl.setProtocol(QLatin1String( "ldaps" ));
+    mUrl.setScheme(QLatin1String( "ldaps" ));
   else
-    mUrl.setProtocol(QLatin1String( "ldap" ));
+    mUrl.setScheme(QLatin1String( "ldap" ));
 
   mUrl.setHost( mCfg->ldaphost() );
   mUrl.setPort( mCfg->ldapport() );
   mUrl.setDn( KLDAP::LdapDN( mCfg->ldapgroupbase() + QLatin1Char( ',' ) + mCfg->ldapdn() ) );
   if ( !mCfg->ldapanon() ) {
-    mUrl.setUser( mCfg->ldapuser() );
-    mUrl.setPass( mCfg->ldappassword() );
+    mUrl.setUserName( mCfg->ldapuser() );
+    mUrl.setPassword( mCfg->ldappassword() );
     QString binddn = mCfg->ldapbinddn();
     if ( !binddn.isEmpty() )
       mUrl.setExtension( QLatin1String( "bindname" ),binddn );
diff -Naur kuser-16.08.3/ku_main.cpp kuser-16.08.3.new/ku_main.cpp
--- kuser-16.08.3/ku_main.cpp	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_main.cpp	2017-01-16 21:13:11.000000000 +0800
@@ -33,15 +33,19 @@
 #include "ku_misc.h"
 #include "ku_mainwidget.h"
 
+#include <klocale.h>
+#include <k4aboutdata.h>
+#include <KGlobal>
+
 static const char *description =
 	I18N_NOOP("KDE User Editor");
 
 int main(int argc, char **argv) 
 {
+    K4AboutData aboutData("kuser", 0, ki18n("KUser"), _KU_VERSION, ki18n(description), K4AboutData::License_GPL,
+                         ki18n("(c) 1997-2000, Denis Perchine\n(c) 2004, Szombathelyi György"), KLocalizedString(), 
+                          "http://kde.org/applications/system/kuser/");
   
-  KAboutData aboutData("kuser", 0, ki18n("KUser"),
-    _KU_VERSION, ki18n(description), KAboutData::License_GPL, 
-    ki18n("(c) 1997-2000, Denis Perchine\n(c) 2004, Szombathelyi György"));
   aboutData.addAuthor(ki18n("Denis Perchine"), ki18n("kuser author"),
     "dyp@perchine.com", "http://www.perchine.com/dyp/");
   aboutData.addAuthor(ki18n("Szombathelyi György"), ki18n("kuser author"),
diff -Naur kuser-16.08.3/ku_mainwidget.cpp kuser-16.08.3.new/ku_mainwidget.cpp
--- kuser-16.08.3/ku_mainwidget.cpp	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_mainwidget.cpp	2017-01-16 21:13:11.000000000 +0800
@@ -48,13 +48,13 @@
   init();
   mv->slotTabChanged();
 
-  statusBar()->insertItem(i18n("Reading configuration"), 0);
+  statusBar()->showMessage(i18n("Reading configuration"), 0);
 
   setCentralWidget(mv);
 
   setupGUI();
 
-  statusBar()->changeItem(i18n("Ready"), 0);
+  statusBar()->showMessage(i18n("Ready"), 0);
 }
 
 KU_MainWidget::~KU_MainWidget()
diff -Naur kuser-16.08.3/kuser.desktop kuser-16.08.3.new/kuser.desktop
--- kuser-16.08.3/kuser.desktop	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/kuser.desktop	2017-01-18 16:05:42.000000000 +0800
@@ -156,7 +156,7 @@
 GenericName[zh_CN]=用户管理程序
 GenericName[zh_HK]=用戶管理員
 GenericName[zh_TW]=使用者管理程式
-Exec=kuser %i -caption %c
+Exec=dbus-run-session kuser %i -caption %c
 Icon=kuser
 Type=Application
 X-DocPath=kuser/index.html
diff -Naur kuser-16.08.3/ku_userldap.cpp kuser-16.08.3.new/ku_userldap.cpp
--- kuser-16.08.3/ku_userldap.cpp	2015-11-15 01:32:18.000000000 +0800
+++ kuser-16.08.3.new/ku_userldap.cpp	2017-01-16 21:13:11.000000000 +0800
@@ -37,16 +37,16 @@
   schemaversion = 0;
 
   if ( mCfg->ldapssl() )
-    mUrl.setProtocol(QLatin1String( "ldaps" ));
+    mUrl.setScheme(QLatin1String( "ldaps" ));
   else
-    mUrl.setProtocol(QLatin1String( "ldap" ));
+    mUrl.setScheme(QLatin1String( "ldap" ));
 
   mUrl.setHost( mCfg->ldaphost() );
   mUrl.setPort( mCfg->ldapport() );
   mUrl.setDn( KLDAP::LdapDN( mCfg->ldapuserbase() + QLatin1Char( ',' ) + mCfg->ldapdn() ) );
   if ( !mCfg->ldapanon() ) {
-    mUrl.setUser( mCfg->ldapuser() );
-    mUrl.setPass( mCfg->ldappassword() );
+    mUrl.setUserName( mCfg->ldapuser() );
+    mUrl.setPassword( mCfg->ldappassword() );
     QString binddn = mCfg->ldapbinddn();
     if ( !binddn.isEmpty() )
       mUrl.setExtension( QLatin1String( "bindname" ),binddn );