[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kopete/dev-0.12/kopete/protocols/winpopup
From:       Gerd Fleischer <gerdfleischer () web ! de>
Date:       2006-01-31 16:36:23
Message-ID: 1138725383.050025.31405.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 504283 by geflei:

fix permission check for message file directory

 M  +10 -7     libwinpopup/libwinpopup.cpp  
 M  +14 -10    ui/wpeditaccountbase.ui  


--- branches/work/kopete/dev-0.12/kopete/protocols/winpopup/libwinpopup/libwinpopup.cpp \
#504282:504283 @@ -99,26 +99,29 @@
 	QDir dir(WP_POPUP_DIR);
 	if (! dir.exists()) {
 		int tmpYesNo =  KMessageBox::warningYesNo(Kopete::UI::Global::mainWidget(), \
                i18n("Working directory /var/lib/winpopup/ does not exist.\n"
-								     "If you have not configured anything yet (samba) it may be better to \
                call\n"
-								     "Install Into Samba (Configure... -> Account -> Edit)\n"
+								     "If you have not configured anything yet (samba) please see\n"
+								     "Install Into Samba (Configure... -> Account -> Edit) information\n"
+								     "on how to do this.\n"
 								     "Should the directory be created? (May need root password)"), \
QString::null, i18n("Create Directory"), i18n("Do Not Create"));  if (tmpYesNo == \
                KMessageBox::Yes) {
-			QString kdesuArgs = "mkdir -p -m 0777 /var/lib/winpopup";
+			QStringList kdesuArgs = QStringList(QString::fromLatin1("-c mkdir -p -m 0777 \
/var/lib/winpopup"));  if (KApplication::kdeinitExecWait("kdesu", kdesuArgs) == 0) \
return true;  }
 	} else {
 		KFileItem tmpFileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, \
                "/var/lib/winpopup/");
-		QString tmpPerms = tmpFileItem.permissionsString();
+		mode_t tmpPerms = tmpFileItem.permissions();
 
-		if (tmpPerms != "drwxrwxrwx") {
+		if (tmpPerms != 0777) {
 
 			kdDebug(14170) << "Perms not ok!" << endl;
 
 			int tmpYesNo =  KMessageBox::warningYesNo(Kopete::UI::Global::mainWidget(), \
i18n("Permissions of the working directory "  "/var/lib/winpopup/ are wrong!\n"
+									     "You will not receive messages if you say no.\n"
+								         "You can also correct it manually (chmod 0777 /var/lib/winpopup) \
                and restart kopete.\n"
 									     "Fix? (May need root password)"), QString::null, i18n("Fix"), i18n("Do \
Not Fix"));  if (tmpYesNo == KMessageBox::Yes) {
-				QString kdesuArgs = "chmod 0777 /var/lib/winpopup";
+				QStringList kdesuArgs = QStringList(QString::fromLatin1("-c chmod 0777 \
                /var/lib/winpopup"));
 				if (KApplication::kdeinitExecWait("kdesu", kdesuArgs) == 0) return true;
 			}
 		} else {
@@ -274,7 +277,7 @@
 											"Fix? (May need root password)"), QString::null, i18n("Fix"), i18n("Do \
Not Fix"));  if (tmpYesNo == KMessageBox::Yes) {
 							QFileInfo messageFileInfo(messageFile);
-							QString kdesuArgs = "chmod 0666 /var/lib/winpopup/" + \
messageFileInfo.fileName(); +							QStringList kdesuArgs = QStringList(QString("-c \
chmod 0666 /var/lib/winpopup/" + messageFileInfo.fileName()));  if \
(KApplication::kdeinitExecWait("kdesu", kdesuArgs) == 0) {  if \
                (!messageFile.remove())
 									KMessageBox::error(Kopete::UI::Global::mainWidget(), i18n("Still cannot \
                remove it; please fix manually."));
--- branches/work/kopete/dev-0.12/kopete/protocols/winpopup/ui/wpeditaccountbase.ui \
#504282:504283 @@ -8,8 +8,8 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>519</width>
-            <height>403</height>
+            <width>524</width>
+            <height>493</height>
         </rect>
     </property>
     <property name="caption">
@@ -45,13 +45,13 @@
                     <cstring>tab</cstring>
                 </property>
                 <attribute name="title">
-                    <string>Basic &amp;Setup</string>
+                    <string>Basi&amp;c Setup</string>
                 </attribute>
-                <grid>
+                <vbox>
                     <property name="name">
                         <cstring>unnamed</cstring>
                     </property>
-                    <widget class="QGroupBox" row="0" column="0">
+                    <widget class="QGroupBox">
                         <property name="name">
                             <cstring>groupBox51</cstring>
                         </property>
@@ -127,7 +127,7 @@
                             </widget>
                         </vbox>
                     </widget>
-                    <widget class="QGroupBox" row="1" column="0">
+                    <widget class="QGroupBox">
                         <property name="name">
                             <cstring>groupBox22</cstring>
                         </property>
@@ -151,7 +151,11 @@
                                     </sizepolicy>
                                 </property>
                                 <property name="text">
-                                    <string>To receive WinPopup messages sent from \
other machines, the hostname above must be set to this machine's hostname.</string> + \
<string>To receive WinPopup messages sent from other machines, the hostname above \
must be set to this machine's hostname.&lt;br&gt; +&lt;br&gt;
+"Install into Samba" is a simple method to create the directory for the temporary \
message files and configure your samba server.&lt;br&gt; +However, the recommended \
way is to ask your administrator to create this directory ('mkdir -p -m 0777 \
/var/lib/winpopup') and add +'message command = _PATH_TO_/winpopup-send.sh %s %m \
&amp;' (substitute _PATH_TO_ by the real path) to your smb.conf \
[global]-section.</string>  </property>
                                 <property name="alignment">
                                     <set>WordBreak|AlignTop</set>
@@ -159,7 +163,7 @@
                             </widget>
                         </grid>
                     </widget>
-                    <spacer row="2" column="0">
+                    <spacer>
                         <property name="name">
                             <cstring>spacer30</cstring>
                         </property>
@@ -172,11 +176,11 @@
                         <property name="sizeHint">
                             <size>
                                 <width>20</width>
-                                <height>140</height>
+                                <height>80</height>
                             </size>
                         </property>
                     </spacer>
-                </grid>
+                </vbox>
             </widget>
             <widget class="QWidget">
                 <property name="name">


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic