@ -24,6 +24,7 @@
# include <tqtextcodec.h>
# include <tqtextcodec.h>
# include <krun.h>
# include <krun.h>
# include <tdefile.h>
# include <tdelocale.h>
# include <tdelocale.h>
# include <tdeapplication.h>
# include <tdeapplication.h>
# include <tdecmdlineargs.h>
# include <tdecmdlineargs.h>
@ -31,6 +32,8 @@
# include <kinputdialog.h>
# include <kinputdialog.h>
# include <tdemessagebox.h>
# include <tdemessagebox.h>
# include <tdeconfig.h>
# include <tdeconfig.h>
# include <kurlrequester.h>
# include <kurlrequesterdlg.h>
# include <stdlib.h>
# include <stdlib.h>
@ -51,10 +54,12 @@ void readXdgUserDirs(TQString *desktop, TQString *documents)
TQString line = s . readLine ( ) ;
TQString line = s . readLine ( ) ;
while ( ! line . isNull ( ) )
while ( ! line . isNull ( ) )
{
{
if ( line . startsWith ( " XDG_DESKTOP_DIR= " ) )
if ( line . startsWith ( " XDG_DESKTOP_DIR= " ) ) {
* desktop = TQString ( line . remove ( " XDG_DESKTOP_DIR= " ) . remove ( " \" " ) ) . replace ( " $HOME " , TQDir : : homeDirPath ( ) ) ;
* desktop = TQString ( line . remove ( " XDG_DESKTOP_DIR= " ) . remove ( " \" " ) ) . replace ( " $HOME " , TQDir : : homeDirPath ( ) ) ;
else if ( line . startsWith ( " XDG_DOCUMENTS_DIR= " ) )
}
else if ( line . startsWith ( " XDG_DOCUMENTS_DIR= " ) ) {
* documents = TQString ( line . remove ( " XDG_DOCUMENTS_DIR= " ) . remove ( " \" " ) ) . replace ( " $HOME " , TQDir : : homeDirPath ( ) ) ;
* documents = TQString ( line . remove ( " XDG_DOCUMENTS_DIR= " ) . remove ( " \" " ) ) . replace ( " $HOME " , TQDir : : homeDirPath ( ) ) ;
}
line = s . readLine ( ) ;
line = s . readLine ( ) ;
}
}
@ -115,7 +120,14 @@ int main( int argc, char **argv)
}
}
}
}
else {
else {
TQString newDirectory = KInputDialog : : text ( " Create Documents directory " , " Please confirm your Documents directory location<br>Upon confimation a new directory will be created " , getDocumentPath ( ) ) ;
KURLRequesterDlg newDirectoryRequester ( getDocumentPath ( ) , i18n ( " Please confirm your Documents directory location<br>Upon confimation a new directory will be created " ) , 0 , NULL , true ) ;
newDirectoryRequester . setCaption ( i18n ( " Create Documents directory " ) ) ;
newDirectoryRequester . urlRequester ( ) - > setMode ( KFile : : Directory ) ;
if ( newDirectoryRequester . exec ( ) ! = TQDialog : : Accepted ) {
return 1 ;
}
else {
TQString newDirectory = newDirectoryRequester . urlRequester ( ) - > url ( ) ;
if ( newDirectory = = TQString : : null ) {
if ( newDirectory = = TQString : : null ) {
return 1 ;
return 1 ;
}
}
@ -163,6 +175,7 @@ int main( int argc, char **argv)
}
}
}
}
}
}
}
else {
else {
printf ( " [kxdglauncher] XDG variable not recognized \n \r " ) ;
printf ( " [kxdglauncher] XDG variable not recognized \n \r " ) ;
return 1 ;
return 1 ;