[问题]KDE4怎么修改成正常时间
发表于 : 2008-06-29 16:41
KUBUNTU4怎么设置时间为正常的时间呀!!!
代码: 全选
/usr/lib/kde4/bin/kdesu systemsettings
补丁早就有了..............可是 kubuntu team 没有用....eexpress 写了:这么复杂的界面,设置个时间。难怪影响开发进度。泥灰上吧。
代码: 全选
diff -ur kdebase-workspace-4.0.72/systemsettings/mainwindow.cpp kdebase-workspace-4.0.72-rootprivs/systemsettings/mainwindow.cpp
--- kdebase-workspace-4.0.72/systemsettings/mainwindow.cpp 2008-04-30 15:58:34.000000000 +0200
+++ kdebase-workspace-4.0.72-rootprivs/systemsettings/mainwindow.cpp 2008-05-07 01:05:14.000000000 +0200
@@ -27,6 +27,7 @@
#include <QLayout>
#include <QStackedWidget>
+#include <QProcess>
#include <KAction>
#include <KActionCollection>
@@ -42,6 +43,7 @@
#include <KStandardAction>
#include <KTabWidget>
#include <kcategorizedsortfilterproxymodel.h>
+#include <KStandardDirs>
#include <kcategorizedview.h>
#include <kcategorydrawer.h>
#include <kiconloader.h>
@@ -297,9 +299,13 @@
return;
MenuItem * mItem = selected.data( Qt::UserRole ).value<MenuItem*>();
+ bool needsRootPrivs = false;
if ( mItem ) {
kDebug() << "Selected item: " << mItem->service->name();
kDebug() << "Comment: " << mItem->service->comment();
+
+ needsRootPrivs = mItem->service->property( "X-KDE-RootOnly", QVariant::Bool ).toBool();
+ kDebug() << "Needs root privs:" << needsRootPrivs;
} else {
kDebug() << ":'( Got dud pointer from " << selected.data( Qt::DisplayRole ).toString();
Q_ASSERT(mItem); // Would core dump below. Do it now
@@ -311,6 +317,35 @@
if ( groupWidget )
return;
+ if ( needsRootPrivs )
+ {
+ QString kdesu = KStandardDirs::findExe( "kdesu" );
+ //kDebug() << "kdesu path:" << kdesu;
+
+ QString cmd = mItem->service->exec().trimmed();
+
+ /* Prepare the process to run the kcmshell */
+ if ( cmd.left(5) == "kdesu" )
+ {
+ cmd = cmd.remove(0,5).trimmed();
+
+ /* Remove all kdesu switches */
+ while ( cmd.length() > 1 && cmd[ 0 ] == '-' )
+ cmd = cmd.remove( 0, cmd.indexOf( ' ' ) ).trimmed();
+ }
+
+ if ( cmd.left(9) == "kcmshell4" )
+ cmd = cmd.remove(0,9).trimmed();
+
+ QStringList args;
+ args << "-c" << QString( "%1 %2 --lang %3" ).arg( KStandardDirs::locate("exe", "kcmshell4") ).arg( cmd ).arg( KGlobal::locale()->language() );
+
+ kDebug() << "Starting root module: " << args;
+ QProcess::execute( kdesu, args );
+
+ return;
+ }
+
groupWidget = moduleItemToWidgetDict[mItem->service];
if( !groupWidget ) {
是你自己觉得复杂...........日期..时间..时区..就三个设置..何来复杂一说? 可笑eexpress 写了:这么复杂的界面,设置个时间。难怪影响开发进度。泥灰上吧。
人家,刚回来,先让人家休息休息.!eexpress 写了:这么复杂的界面,设置个时间。难怪影响开发进度。泥灰上吧。