author | zautrix <zautrix> | 2004-10-03 18:03:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-03 18:03:18 (UTC) |
commit | dd8f6efd23350b101065ddb64f35920f24010185 (patch) (unidiff) | |
tree | 76475452c6c8854178a84e5fff863a21a8e117d3 | |
parent | 2a7b61c2b45a0a0344ae65633b2578b4cde1753f (diff) | |
download | kdepimpi-dd8f6efd23350b101065ddb64f35920f24010185.zip kdepimpi-dd8f6efd23350b101065ddb64f35920f24010185.tar.gz kdepimpi-dd8f6efd23350b101065ddb64f35920f24010185.tar.bz2 |
Fixes for desktop. Fixed kdehomedir on wintendo
-rw-r--r-- | korganizer/mainwindow.cpp | 10 | ||||
-rw-r--r-- | libkdepim/libkdepim.pro | 2 | ||||
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 27 |
3 files changed, 27 insertions, 12 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index f4ac0d6..7bf33d3 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -808,135 +808,135 @@ void MainWindow::initActions() | |||
808 | connect( action, SIGNAL( activated() ), | 808 | connect( action, SIGNAL( activated() ), |
809 | mView, SLOT( goNextMonth() ) ); | 809 | mView, SLOT( goNextMonth() ) ); |
810 | action->addTo( iconToolBar ); | 810 | action->addTo( iconToolBar ); |
811 | } | 811 | } |
812 | 812 | ||
813 | 813 | ||
814 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 814 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
815 | 815 | ||
816 | if (p-> mShowIconNewEvent) | 816 | if (p-> mShowIconNewEvent) |
817 | configureToolBarMenu->setItemChecked( 10, true ); | 817 | configureToolBarMenu->setItemChecked( 10, true ); |
818 | if (p->mShowIconNewTodo ) | 818 | if (p->mShowIconNewTodo ) |
819 | configureToolBarMenu->setItemChecked( 20, true ); | 819 | configureToolBarMenu->setItemChecked( 20, true ); |
820 | if (p-> mShowIconSearch) | 820 | if (p-> mShowIconSearch) |
821 | configureToolBarMenu->setItemChecked( 120, true ); | 821 | configureToolBarMenu->setItemChecked( 120, true ); |
822 | if (p-> mShowIconList) | 822 | if (p-> mShowIconList) |
823 | configureToolBarMenu->setItemChecked( 30, true ); | 823 | configureToolBarMenu->setItemChecked( 30, true ); |
824 | if (p-> mShowIconDay1) | 824 | if (p-> mShowIconDay1) |
825 | configureToolBarMenu->setItemChecked( 40, true ); | 825 | configureToolBarMenu->setItemChecked( 40, true ); |
826 | if (p-> mShowIconDay5) | 826 | if (p-> mShowIconDay5) |
827 | configureToolBarMenu->setItemChecked( 50, true ); | 827 | configureToolBarMenu->setItemChecked( 50, true ); |
828 | if (p-> mShowIconDay7) | 828 | if (p-> mShowIconDay7) |
829 | configureToolBarMenu->setItemChecked( 60, true ); | 829 | configureToolBarMenu->setItemChecked( 60, true ); |
830 | if (p-> mShowIconMonth) | 830 | if (p-> mShowIconMonth) |
831 | configureToolBarMenu->setItemChecked( 70, true ); | 831 | configureToolBarMenu->setItemChecked( 70, true ); |
832 | if (p-> mShowIconTodoview) | 832 | if (p-> mShowIconTodoview) |
833 | configureToolBarMenu->setItemChecked( 80, true ); | 833 | configureToolBarMenu->setItemChecked( 80, true ); |
834 | if (p-> mShowIconBackFast) | 834 | if (p-> mShowIconBackFast) |
835 | configureToolBarMenu->setItemChecked( 200, true ); | 835 | configureToolBarMenu->setItemChecked( 200, true ); |
836 | if (p-> mShowIconBack) | 836 | if (p-> mShowIconBack) |
837 | configureToolBarMenu->setItemChecked( 210, true ); | 837 | configureToolBarMenu->setItemChecked( 210, true ); |
838 | if (p-> mShowIconToday) | 838 | if (p-> mShowIconToday) |
839 | configureToolBarMenu->setItemChecked( 130, true ); | 839 | configureToolBarMenu->setItemChecked( 130, true ); |
840 | if (p-> mShowIconForward) | 840 | if (p-> mShowIconForward) |
841 | configureToolBarMenu->setItemChecked( 220, true ); | 841 | configureToolBarMenu->setItemChecked( 220, true ); |
842 | if (p-> mShowIconForwardFast) | 842 | if (p-> mShowIconForwardFast) |
843 | configureToolBarMenu->setItemChecked( 230, true ); | 843 | configureToolBarMenu->setItemChecked( 230, true ); |
844 | if (p-> mShowIconNextDays) | 844 | if (p-> mShowIconNextDays) |
845 | configureToolBarMenu->setItemChecked( 100, true ); | 845 | configureToolBarMenu->setItemChecked( 100, true ); |
846 | if (p-> mShowIconNext) | 846 | if (p-> mShowIconNext) |
847 | configureToolBarMenu->setItemChecked( 110, true ); | 847 | configureToolBarMenu->setItemChecked( 110, true ); |
848 | if (p-> mShowIconJournal) | 848 | if (p-> mShowIconJournal) |
849 | configureToolBarMenu->setItemChecked( 90, true ); | 849 | configureToolBarMenu->setItemChecked( 90, true ); |
850 | if (p-> mShowIconWhatsThis) | 850 | if (p-> mShowIconWhatsThis) |
851 | configureToolBarMenu->setItemChecked( 300, true ); | 851 | configureToolBarMenu->setItemChecked( 300, true ); |
852 | 852 | ||
853 | QLabel* dummy = new QLabel( iconToolBar ); | 853 | QLabel* dummy = new QLabel( iconToolBar ); |
854 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 854 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
855 | if (!p-> mShowIconStretch) | 855 | if (!p-> mShowIconStretch) |
856 | iconToolBar->setStretchableWidget ( dummy ) ; | 856 | iconToolBar->setStretchableWidget ( dummy ) ; |
857 | else | 857 | else |
858 | configureToolBarMenu->setItemChecked( 5, true ); | 858 | configureToolBarMenu->setItemChecked( 5, true ); |
859 | if (p-> mShowIconWhatsThis) | 859 | if (p-> mShowIconWhatsThis) |
860 | QWhatsThis::whatsThisButton ( iconToolBar ); | 860 | QWhatsThis::whatsThisButton ( iconToolBar ); |
861 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 861 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
862 | configureAgenda( p->mHourSize ); | 862 | configureAgenda( p->mHourSize ); |
863 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 863 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
864 | } | 864 | } |
865 | void MainWindow::fillSyncMenu() | 865 | void MainWindow::fillSyncMenu() |
866 | { | 866 | { |
867 | if ( syncMenu->count() ) | 867 | if ( syncMenu->count() ) |
868 | syncMenu->clear(); | 868 | syncMenu->clear(); |
869 | syncMenu->insertItem( i18n("Configure..."), 0 ); | 869 | syncMenu->insertItem( i18n("Configure..."), 0 ); |
870 | syncMenu->insertSeparator(); | 870 | syncMenu->insertSeparator(); |
871 | if ( mServerSocket == 0 ) { | 871 | if ( mServerSocket == 0 ) { |
872 | syncMenu->insertItem( i18n("Enable Easy-Pi-Sync"), 2 ); | 872 | syncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); |
873 | } else { | 873 | } else { |
874 | syncMenu->insertItem( i18n("Disable Easy-Pi-Sync"), 3 ); | 874 | syncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); |
875 | } | 875 | } |
876 | syncMenu->insertSeparator(); | 876 | syncMenu->insertSeparator(); |
877 | syncMenu->insertItem( i18n("New Easy-Pi-Sync!"), 4 ); | 877 | syncMenu->insertItem( i18n("New Pi-Sync!"), 4 ); |
878 | syncMenu->insertItem( i18n("Quick Easy-Pi-Sync!"), 5 ); | 878 | syncMenu->insertItem( i18n("Quick Pi-Sync!"), 5 ); |
879 | syncMenu->insertSeparator(); | 879 | syncMenu->insertSeparator(); |
880 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); | 880 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); |
881 | syncMenu->insertSeparator(); | 881 | syncMenu->insertSeparator(); |
882 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 882 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
883 | config.setGroup("General"); | 883 | config.setGroup("General"); |
884 | QStringList prof = config.readListEntry("SyncProfileNames"); | 884 | QStringList prof = config.readListEntry("SyncProfileNames"); |
885 | KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); | 885 | KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); |
886 | if ( prof.count() < 3 ) { | 886 | if ( prof.count() < 3 ) { |
887 | prof.clear(); | 887 | prof.clear(); |
888 | prof << i18n("Sharp_DTM"); | 888 | prof << i18n("Sharp_DTM"); |
889 | prof << i18n("Local_file"); | 889 | prof << i18n("Local_file"); |
890 | prof << i18n("Last_file"); | 890 | prof << i18n("Last_file"); |
891 | KSyncProfile* temp = new KSyncProfile (); | 891 | KSyncProfile* temp = new KSyncProfile (); |
892 | temp->setName( prof[0] ); | 892 | temp->setName( prof[0] ); |
893 | temp->writeConfig(&config); | 893 | temp->writeConfig(&config); |
894 | temp->setName( prof[1] ); | 894 | temp->setName( prof[1] ); |
895 | temp->writeConfig(&config); | 895 | temp->writeConfig(&config); |
896 | temp->setName( prof[2] ); | 896 | temp->setName( prof[2] ); |
897 | temp->writeConfig(&config); | 897 | temp->writeConfig(&config); |
898 | config.setGroup("General"); | 898 | config.setGroup("General"); |
899 | config.writeEntry("SyncProfileNames",prof); | 899 | config.writeEntry("SyncProfileNames",prof); |
900 | config.writeEntry("ExternSyncProfiles","Sharp_DTM"); | 900 | config.writeEntry("ExternSyncProfiles","Sharp_DTM"); |
901 | config.sync(); | 901 | config.sync(); |
902 | delete temp; | 902 | delete temp; |
903 | } | 903 | } |
904 | KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); | 904 | KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); |
905 | KOPrefs::instance()->mSyncProfileNames = prof; | 905 | KOPrefs::instance()->mSyncProfileNames = prof; |
906 | int i; | 906 | int i; |
907 | for ( i = 0; i < prof.count(); ++i ) { | 907 | for ( i = 0; i < prof.count(); ++i ) { |
908 | 908 | ||
909 | syncMenu->insertItem( prof[i], 1000+i ); | 909 | syncMenu->insertItem( prof[i], 1000+i ); |
910 | if ( i == 2 ) | 910 | if ( i == 2 ) |
911 | syncMenu->insertSeparator(); | 911 | syncMenu->insertSeparator(); |
912 | } | 912 | } |
913 | QDir app_dir; | 913 | QDir app_dir; |
914 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 914 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
915 | syncMenu->setItemEnabled( false , 1000 ); | 915 | syncMenu->setItemEnabled( false , 1000 ); |
916 | } | 916 | } |
917 | mView->setupExternSyncProfiles(); | 917 | mView->setupExternSyncProfiles(); |
918 | } | 918 | } |
919 | 919 | ||
920 | int MainWindow::ringSync() | 920 | int MainWindow::ringSync() |
921 | { | 921 | { |
922 | int syncedProfiles = 0; | 922 | int syncedProfiles = 0; |
923 | int i; | 923 | int i; |
924 | QTime timer; | 924 | QTime timer; |
925 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 925 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
926 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 926 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; |
927 | KSyncProfile* temp = new KSyncProfile (); | 927 | KSyncProfile* temp = new KSyncProfile (); |
928 | KOPrefs::instance()->mAskForPreferences = false; | 928 | KOPrefs::instance()->mAskForPreferences = false; |
929 | for ( i = 0; i < syncProfileNames.count(); ++i ) { | 929 | for ( i = 0; i < syncProfileNames.count(); ++i ) { |
930 | mCurrentSyncProfile = i; | 930 | mCurrentSyncProfile = i; |
931 | temp->setName(syncProfileNames[mCurrentSyncProfile]); | 931 | temp->setName(syncProfileNames[mCurrentSyncProfile]); |
932 | temp->readConfig(&config); | 932 | temp->readConfig(&config); |
933 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { | 933 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { |
934 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); | 934 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); |
935 | ++syncedProfiles; | 935 | ++syncedProfiles; |
936 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); | 936 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); |
937 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); | 937 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); |
938 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); | 938 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); |
939 | KOPrefs::instance()->mWriteBackInFuture = 0; | 939 | KOPrefs::instance()->mWriteBackInFuture = 0; |
940 | if ( temp->getWriteBackFuture() ) | 940 | if ( temp->getWriteBackFuture() ) |
941 | KOPrefs::instance()->mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); | 941 | KOPrefs::instance()->mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); |
942 | KOPrefs::instance()->mShowSyncSummary = false; | 942 | KOPrefs::instance()->mShowSyncSummary = false; |
@@ -1946,129 +1946,131 @@ void MainWindow::sendFile(QSocket* socket) | |||
1946 | lay->setSpacing(7); | 1946 | lay->setSpacing(7); |
1947 | mSyncActionDialog->setFixedSize( 200,100 ); | 1947 | mSyncActionDialog->setFixedSize( 200,100 ); |
1948 | mSyncActionDialog->show(); | 1948 | mSyncActionDialog->show(); |
1949 | qApp->processEvents(); | 1949 | qApp->processEvents(); |
1950 | qDebug("saving ... "); | 1950 | qDebug("saving ... "); |
1951 | save(); | 1951 | save(); |
1952 | QString fileName = defaultFileName(); | 1952 | QString fileName = defaultFileName(); |
1953 | QFile file( fileName ); | 1953 | QFile file( fileName ); |
1954 | if (!file.open( IO_ReadOnly ) ) { | 1954 | if (!file.open( IO_ReadOnly ) ) { |
1955 | setCaption( i18n("Error open file") ); | 1955 | setCaption( i18n("Error open file") ); |
1956 | delete mSyncActionDialog; | 1956 | delete mSyncActionDialog; |
1957 | mSyncActionDialog = 0; | 1957 | mSyncActionDialog = 0; |
1958 | qDebug("error open cal file "); | 1958 | qDebug("error open cal file "); |
1959 | return ; | 1959 | return ; |
1960 | 1960 | ||
1961 | } | 1961 | } |
1962 | setCaption( i18n("Sending file...") ); | 1962 | setCaption( i18n("Sending file...") ); |
1963 | QTextStream ts( &file ); | 1963 | QTextStream ts( &file ); |
1964 | ts.setCodec( QTextCodec::codecForName("utf8") ); | 1964 | ts.setCodec( QTextCodec::codecForName("utf8") ); |
1965 | QTextStream os( socket ); | 1965 | QTextStream os( socket ); |
1966 | os.setCodec( QTextCodec::codecForName("utf8") ); | 1966 | os.setCodec( QTextCodec::codecForName("utf8") ); |
1967 | //os.setEncoding( QTextStream::UnicodeUTF8 ); | 1967 | //os.setEncoding( QTextStream::UnicodeUTF8 ); |
1968 | while ( ! ts.atEnd() ) { | 1968 | while ( ! ts.atEnd() ) { |
1969 | os << ts.readLine() << "\n"; | 1969 | os << ts.readLine() << "\n"; |
1970 | } | 1970 | } |
1971 | //os << ts.read(); | 1971 | //os << ts.read(); |
1972 | socket->close(); | 1972 | socket->close(); |
1973 | file.close(); | 1973 | file.close(); |
1974 | setCaption( i18n("File sent. Waiting to get back synced file") ); | 1974 | setCaption( i18n("File sent. Waiting to get back synced file") ); |
1975 | qDebug("file sent "); | 1975 | qDebug("file sent "); |
1976 | } | 1976 | } |
1977 | void MainWindow::getFile(QSocket* socket) | 1977 | void MainWindow::getFile(QSocket* socket) |
1978 | { | 1978 | { |
1979 | setCaption( i18n("Receiving synced file...") ); | 1979 | setCaption( i18n("Receiving synced file...") ); |
1980 | 1980 | ||
1981 | QString fileName = defaultFileName(); | 1981 | QString fileName = defaultFileName(); |
1982 | QFile file( fileName ); | 1982 | QFile file( fileName ); |
1983 | if (!file.open( IO_WriteOnly ) ) { | 1983 | if (!file.open( IO_WriteOnly ) ) { |
1984 | setCaption( i18n("Error open file") ); | 1984 | setCaption( i18n("Error open file") ); |
1985 | delete mSyncActionDialog; | 1985 | delete mSyncActionDialog; |
1986 | mSyncActionDialog = 0; | 1986 | mSyncActionDialog = 0; |
1987 | qDebug("error open cal file "); | 1987 | qDebug("error open cal file "); |
1988 | return ; | 1988 | return ; |
1989 | 1989 | ||
1990 | } | 1990 | } |
1991 | 1991 | ||
1992 | mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); | 1992 | mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); |
1993 | QTextStream ts( &file ); | 1993 | QTextStream ts( &file ); |
1994 | ts.setCodec( QTextCodec::codecForName("utf8") ); | 1994 | ts.setCodec( QTextCodec::codecForName("utf8") ); |
1995 | bool first = true; | 1995 | bool first = true; |
1996 | while ( socket->canReadLine () || first ) { | 1996 | while ( socket->canReadLine () || first ) { |
1997 | first = false; | 1997 | first = false; |
1998 | while ( socket->canReadLine () ) { | 1998 | while ( socket->canReadLine () ) { |
1999 | qDebug("avail %d ", socket->bytesAvailable () ); | 1999 | qDebug("avail %d ", socket->bytesAvailable () ); |
2000 | ts << socket->readLine (); | 2000 | ts << socket->readLine (); |
2001 | } | 2001 | } |
2002 | QTime ti; | 2002 | QTime ti; |
2003 | ti.start(); | 2003 | ti.start(); |
2004 | while ( ti.elapsed () < 5000 && !socket->canReadLine () ) { | 2004 | while ( ti.elapsed () < 5000 && !socket->canReadLine () ) { |
2005 | qDebug("waiting1a %d %d ",ti.elapsed (), socket->bytesAvailable () ); | 2005 | qDebug("waiting1a %d %d ",ti.elapsed (), socket->bytesAvailable () ); |
2006 | //qApp->processEvents(); | 2006 | //qApp->processEvents(); |
2007 | qDebug("waiting1b %d ",ti.elapsed () ); | 2007 | qDebug("waiting1b %d ",ti.elapsed () ); |
2008 | if ( !socket->canReadLine () ) { | 2008 | if ( !socket->canReadLine () ) { |
2009 | qDebug("waiting1c %d ",ti.elapsed () ); | 2009 | qDebug("waiting1c %d ",ti.elapsed () ); |
2010 | #ifndef _WIN32_ | ||
2010 | usleep( 100000); | 2011 | usleep( 100000); |
2012 | #endif | ||
2011 | } | 2013 | } |
2012 | //socket->waitForMore ( 100 ); | 2014 | //socket->waitForMore ( 100 ); |
2013 | } | 2015 | } |
2014 | ts << socket->readLine (); | 2016 | ts << socket->readLine (); |
2015 | #if 0 | 2017 | #if 0 |
2016 | #ifdef DESKTOP_VERSION | 2018 | #ifdef DESKTOP_VERSION |
2017 | socket->waitForMore ( 5000 ); | 2019 | socket->waitForMore ( 5000 ); |
2018 | #else | 2020 | #else |
2019 | // socket->waitForMore ( 5000 ); | 2021 | // socket->waitForMore ( 5000 ); |
2020 | // seems to be broken in qt2 | 2022 | // seems to be broken in qt2 |
2021 | bool stop = false; | 2023 | bool stop = false; |
2022 | QTime ti; | 2024 | QTime ti; |
2023 | ti.start(); | 2025 | ti.start(); |
2024 | while ( ti.elapsed < 5000 && !stop ) { | 2026 | while ( ti.elapsed < 5000 && !stop ) { |
2025 | qApp->processEvents(); | 2027 | qApp->processEvents(); |
2026 | if ( socket->canReadLine () ) | 2028 | if ( socket->canReadLine () ) |
2027 | stop = true ; | 2029 | stop = true ; |
2028 | else { | 2030 | else { |
2029 | usleep( 100000 ); | 2031 | usleep( 100000 ); |
2030 | 2032 | ||
2031 | } | 2033 | } |
2032 | } | 2034 | } |
2033 | #endif | 2035 | #endif |
2034 | #endif | 2036 | #endif |
2035 | } | 2037 | } |
2036 | setCaption( i18n("File received - reloading calendar...") ); | 2038 | setCaption( i18n("File received - reloading calendar...") ); |
2037 | socket->close(); | 2039 | socket->close(); |
2038 | file.close(); | 2040 | file.close(); |
2039 | mView->watchSavedFile(); | 2041 | mView->watchSavedFile(); |
2040 | mView->openCalendar( defaultFileName() ); | 2042 | mView->openCalendar( defaultFileName() ); |
2041 | setCaption( i18n("Easy-Pi-Sync successful!") ); | 2043 | setCaption( i18n("Easy-Pi-Sync successful!") ); |
2042 | delete mSyncActionDialog; | 2044 | delete mSyncActionDialog; |
2043 | mSyncActionDialog = 0; | 2045 | mSyncActionDialog = 0; |
2044 | 2046 | ||
2045 | 2047 | ||
2046 | } | 2048 | } |
2047 | void MainWindow::endConnect() | 2049 | void MainWindow::endConnect() |
2048 | { | 2050 | { |
2049 | setCaption( i18n("No file received - syncing successful") ); | 2051 | setCaption( i18n("No file received - syncing successful") ); |
2050 | delete mSyncActionDialog; | 2052 | delete mSyncActionDialog; |
2051 | mSyncActionDialog = 0; | 2053 | mSyncActionDialog = 0; |
2052 | } | 2054 | } |
2053 | void MainWindow::performQuick() | 2055 | void MainWindow::performQuick() |
2054 | { | 2056 | { |
2055 | setCaption( i18n("Please input connection settings") ); | 2057 | setCaption( i18n("Please input connection settings") ); |
2056 | QString retfile = ""; | 2058 | QString retfile = ""; |
2057 | QDialog dia ( this, "input-dialog", true ); | 2059 | QDialog dia ( this, "input-dialog", true ); |
2058 | QLineEdit lab ( &dia ); | 2060 | QLineEdit lab ( &dia ); |
2059 | QVBoxLayout lay( &dia ); | 2061 | QVBoxLayout lay( &dia ); |
2060 | QLabel label ( i18n("IP address\n(Example: 192.168.0.40)"), &dia ); | 2062 | QLabel label ( i18n("IP address\n(Example: 192.168.0.40)"), &dia ); |
2061 | lay.addWidget( &label); | 2063 | lay.addWidget( &label); |
2062 | lab.setText( KOPrefs::instance()->mActiveSyncIP ); | 2064 | lab.setText( KOPrefs::instance()->mActiveSyncIP ); |
2063 | lay.setMargin(7); | 2065 | lay.setMargin(7); |
2064 | lay.setSpacing(7); | 2066 | lay.setSpacing(7); |
2065 | lay.addWidget( &lab); | 2067 | lay.addWidget( &lab); |
2066 | QLabel label2 ( i18n("Port number (Default: 9197)"), &dia ); | 2068 | QLabel label2 ( i18n("Port number (Default: 9197)"), &dia ); |
2067 | lay.addWidget( &label2); | 2069 | lay.addWidget( &label2); |
2068 | QLineEdit lab2 ( &dia ); | 2070 | QLineEdit lab2 ( &dia ); |
2069 | lab2.setText( KOPrefs::instance()->mActiveSyncPort ); | 2071 | lab2.setText( KOPrefs::instance()->mActiveSyncPort ); |
2070 | lay.addWidget( &lab2); | 2072 | lay.addWidget( &lab2); |
2071 | dia.setFixedSize( 230,200 ); | 2073 | dia.setFixedSize( 230,200 ); |
2072 | dia.setCaption( i18n("Enter port for Easy-Pi-Sync ") ); | 2074 | dia.setCaption( i18n("Enter port for Easy-Pi-Sync ") ); |
2073 | QPushButton pb ( "OK", &dia); | 2075 | QPushButton pb ( "OK", &dia); |
2074 | lay.addWidget( &pb ); | 2076 | lay.addWidget( &pb ); |
diff --git a/libkdepim/libkdepim.pro b/libkdepim/libkdepim.pro index 7231842..eac19ea 100644 --- a/libkdepim/libkdepim.pro +++ b/libkdepim/libkdepim.pro | |||
@@ -1,57 +1,59 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
3 | DEFINES +=KORG_NOKABC | 3 | DEFINES +=KORG_NOKABC |
4 | TARGET = microkdepim | 4 | TARGET = microkdepim |
5 | INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . .. | 5 | INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . .. |
6 | DESTDIR=../bin | 6 | DESTDIR=../bin |
7 | 7 | ||
8 | DEFINES += DESKTOP_VERSION | 8 | DEFINES += DESKTOP_VERSION |
9 | include( ../variables.pri ) | 9 | include( ../variables.pri ) |
10 | unix : { | 10 | unix : { |
11 | OBJECTS_DIR = obj/unix | 11 | OBJECTS_DIR = obj/unix |
12 | MOC_DIR = moc/unix | 12 | MOC_DIR = moc/unix |
13 | } | 13 | } |
14 | win32: { | 14 | win32: { |
15 | DEFINES += _WIN32_ | 15 | DEFINES += _WIN32_ |
16 | OBJECTS_DIR = obj/win | 16 | OBJECTS_DIR = obj/win |
17 | MOC_DIR = moc/win | 17 | MOC_DIR = moc/win |
18 | } | 18 | } |
19 | INTERFACES = \ | 19 | INTERFACES = \ |
20 | 20 | ||
21 | HEADERS = \ | 21 | HEADERS = \ |
22 | categoryeditdialog.h \ | 22 | categoryeditdialog.h \ |
23 | categoryeditdialog_base.h \ | 23 | categoryeditdialog_base.h \ |
24 | categoryselectdialog.h \ | 24 | categoryselectdialog.h \ |
25 | categoryselectdialog_base.h \ | 25 | categoryselectdialog_base.h \ |
26 | externalapphandler.h \ | 26 | externalapphandler.h \ |
27 | kdateedit.h \ | 27 | kdateedit.h \ |
28 | kdatepicker.h \ | 28 | kdatepicker.h \ |
29 | kinputdialog.h \ | 29 | kinputdialog.h \ |
30 | kpimprefs.h \ | 30 | kpimprefs.h \ |
31 | kpimglobalprefs.h \ | 31 | kpimglobalprefs.h \ |
32 | kprefsdialog.h \ | 32 | kprefsdialog.h \ |
33 | kprefswidget.h \ | 33 | kprefswidget.h \ |
34 | ksyncmanager.h \ | ||
34 | ksyncprofile.h \ | 35 | ksyncprofile.h \ |
35 | ksyncprefsdialog.h \ | 36 | ksyncprefsdialog.h \ |
36 | kcmconfigs/kcmkdepimconfig.h \ | 37 | kcmconfigs/kcmkdepimconfig.h \ |
37 | kcmconfigs/kdepimconfigwidget.h | 38 | kcmconfigs/kdepimconfigwidget.h |
38 | 39 | ||
39 | SOURCES = \ | 40 | SOURCES = \ |
40 | categoryeditdialog.cpp \ | 41 | categoryeditdialog.cpp \ |
41 | categoryeditdialog_base.cpp \ | 42 | categoryeditdialog_base.cpp \ |
42 | categoryselectdialog.cpp \ | 43 | categoryselectdialog.cpp \ |
43 | categoryselectdialog_base.cpp \ | 44 | categoryselectdialog_base.cpp \ |
44 | externalapphandler.cpp \ | 45 | externalapphandler.cpp \ |
45 | kdateedit.cpp \ | 46 | kdateedit.cpp \ |
46 | kdatepicker.cpp \ | 47 | kdatepicker.cpp \ |
47 | kinputdialog.cpp \ | 48 | kinputdialog.cpp \ |
48 | kpimprefs.cpp \ | 49 | kpimprefs.cpp \ |
49 | kpimglobalprefs.cpp \ | 50 | kpimglobalprefs.cpp \ |
50 | kprefsdialog.cpp \ | 51 | kprefsdialog.cpp \ |
51 | kprefswidget.cpp \ | 52 | kprefswidget.cpp \ |
53 | ksyncmanager.cpp \ | ||
52 | ksyncprofile.cpp \ | 54 | ksyncprofile.cpp \ |
53 | ksyncprefsdialog.cpp \ | 55 | ksyncprefsdialog.cpp \ |
54 | kcmconfigs/kcmkdepimconfig.cpp \ | 56 | kcmconfigs/kcmkdepimconfig.cpp \ |
55 | kcmconfigs/kdepimconfigwidget.cpp | 57 | kcmconfigs/kdepimconfigwidget.cpp |
56 | 58 | ||
57 | 59 | ||
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index 7f2a326..1c3e0ae 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp | |||
@@ -1,108 +1,109 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 1999 Sirtaj Singh Kang <taj@kde.org> | 2 | Copyright (C) 1999 Sirtaj Singh Kang <taj@kde.org> |
3 | Copyright (C) 1999 Stephan Kulow <coolo@kde.org> | 3 | Copyright (C) 1999 Stephan Kulow <coolo@kde.org> |
4 | Copyright (C) 1999 Waldo Bastian <bastian@kde.org> | 4 | Copyright (C) 1999 Waldo Bastian <bastian@kde.org> |
5 | 5 | ||
6 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public | 7 | modify it under the terms of the GNU Library General Public |
8 | License version 2 as published by the Free Software Foundation. | 8 | License version 2 as published by the Free Software Foundation. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * Author: Stephan Kulow <coolo@kde.org> and Sirtaj Singh Kang <taj@kde.org> | 22 | * Author: Stephan Kulow <coolo@kde.org> and Sirtaj Singh Kang <taj@kde.org> |
23 | * Version:$Id$ | 23 | * Version:$Id$ |
24 | * Generated:Thu Mar 5 16:05:28 EST 1998 | 24 | * Generated:Thu Mar 5 16:05:28 EST 1998 |
25 | */ | 25 | */ |
26 | 26 | ||
27 | //US #include "config.h" | 27 | //US #include "config.h" |
28 | 28 | ||
29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
30 | #include <assert.h> | 30 | #include <assert.h> |
31 | //US#include <errno.h> | 31 | //US#include <errno.h> |
32 | //US #ifdef HAVE_SYS_STAT_H | 32 | //US #ifdef HAVE_SYS_STAT_H |
33 | //US #include <sys/stat.h> | 33 | //US #include <sys/stat.h> |
34 | //US #endif | 34 | //US #endif |
35 | //US#include <sys/types.h> | 35 | //US#include <sys/types.h> |
36 | //US#include <dirent.h> | 36 | //US#include <dirent.h> |
37 | //US#include <pwd.h> | 37 | //US#include <pwd.h> |
38 | 38 | ||
39 | #include <qregexp.h> | 39 | #include <qregexp.h> |
40 | #include <qasciidict.h> | 40 | #include <qasciidict.h> |
41 | #include <qdict.h> | 41 | #include <qdict.h> |
42 | #include <qdir.h> | 42 | #include <qdir.h> |
43 | #include <qfileinfo.h> | 43 | #include <qfileinfo.h> |
44 | #include <qstring.h> | 44 | #include <qstring.h> |
45 | #include <qmessagebox.h> | ||
45 | #include <qapplication.h> | 46 | #include <qapplication.h> |
46 | 47 | ||
47 | #include <qstringlist.h> | 48 | #include <qstringlist.h> |
48 | 49 | ||
49 | #include "kstandarddirs.h" | 50 | #include "kstandarddirs.h" |
50 | #include "kconfig.h" | 51 | #include "kconfig.h" |
51 | #include "kdebug.h" | 52 | #include "kdebug.h" |
52 | //US #include "kinstance.h" | 53 | //US #include "kinstance.h" |
53 | #include "kshell.h" | 54 | #include "kshell.h" |
54 | //US#include <sys/param.h> | 55 | //US#include <sys/param.h> |
55 | //US#include <unistd.h> | 56 | //US#include <unistd.h> |
56 | 57 | ||
57 | //US | 58 | //US |
58 | QString KStandardDirs::mAppDir = QString::null; | 59 | QString KStandardDirs::mAppDir = QString::null; |
59 | 60 | ||
60 | 61 | ||
61 | template class QDict<QStringList>; | 62 | template class QDict<QStringList>; |
62 | 63 | ||
63 | #if 0 | 64 | #if 0 |
64 | #include <qtextedit.h> | 65 | #include <qtextedit.h> |
65 | void ddd( QString op ) | 66 | void ddd( QString op ) |
66 | { | 67 | { |
67 | static QTextEdit * dot = 0; | 68 | static QTextEdit * dot = 0; |
68 | if ( ! dot ) | 69 | if ( ! dot ) |
69 | dot = new QTextEdit(); | 70 | dot = new QTextEdit(); |
70 | 71 | ||
71 | dot->show(); | 72 | dot->show(); |
72 | 73 | ||
73 | dot->append( op ); | 74 | dot->append( op ); |
74 | 75 | ||
75 | } | 76 | } |
76 | #endif | 77 | #endif |
77 | class KStandardDirs::KStandardDirsPrivate | 78 | class KStandardDirs::KStandardDirsPrivate |
78 | { | 79 | { |
79 | public: | 80 | public: |
80 | KStandardDirsPrivate() | 81 | KStandardDirsPrivate() |
81 | : restrictionsActive(false), | 82 | : restrictionsActive(false), |
82 | dataRestrictionActive(false) | 83 | dataRestrictionActive(false) |
83 | { } | 84 | { } |
84 | 85 | ||
85 | bool restrictionsActive; | 86 | bool restrictionsActive; |
86 | bool dataRestrictionActive; | 87 | bool dataRestrictionActive; |
87 | QAsciiDict<bool> restrictions; | 88 | QAsciiDict<bool> restrictions; |
88 | QStringList xdgdata_prefixes; | 89 | QStringList xdgdata_prefixes; |
89 | QStringList xdgconf_prefixes; | 90 | QStringList xdgconf_prefixes; |
90 | }; | 91 | }; |
91 | 92 | ||
92 | static const char* const types[] = {"html", "icon", "apps", "sound", | 93 | static const char* const types[] = {"html", "icon", "apps", "sound", |
93 | "data", "locale", "services", "mime", | 94 | "data", "locale", "services", "mime", |
94 | "servicetypes", "config", "exe", "tmp", | 95 | "servicetypes", "config", "exe", "tmp", |
95 | "wallpaper", "lib", "pixmap", "templates", | 96 | "wallpaper", "lib", "pixmap", "templates", |
96 | "module", "qtplugins", | 97 | "module", "qtplugins", |
97 | "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu", 0 }; | 98 | "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu", 0 }; |
98 | 99 | ||
99 | static int tokenize( QStringList& token, const QString& str, | 100 | static int tokenize( QStringList& token, const QString& str, |
100 | const QString& delim ); | 101 | const QString& delim ); |
101 | 102 | ||
102 | KStandardDirs::KStandardDirs( ) : addedCustoms(false) | 103 | KStandardDirs::KStandardDirs( ) : addedCustoms(false) |
103 | { | 104 | { |
104 | d = new KStandardDirsPrivate; | 105 | d = new KStandardDirsPrivate; |
105 | dircache.setAutoDelete(true); | 106 | dircache.setAutoDelete(true); |
106 | relatives.setAutoDelete(true); | 107 | relatives.setAutoDelete(true); |
107 | absolutes.setAutoDelete(true); | 108 | absolutes.setAutoDelete(true); |
108 | savelocations.setAutoDelete(true); | 109 | savelocations.setAutoDelete(true); |
@@ -1143,193 +1144,203 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) | |||
1143 | #ifndef _WIN32_ | 1144 | #ifndef _WIN32_ |
1144 | if (dir.at(0) != '/') | 1145 | if (dir.at(0) != '/') |
1145 | return false; | 1146 | return false; |
1146 | #endif | 1147 | #endif |
1147 | 1148 | ||
1148 | QString target = dir; | 1149 | QString target = dir; |
1149 | uint len = target.length(); | 1150 | uint len = target.length(); |
1150 | #ifndef _WIN32_ | 1151 | #ifndef _WIN32_ |
1151 | // append trailing slash if missing | 1152 | // append trailing slash if missing |
1152 | if (dir.at(len - 1) != '/') | 1153 | if (dir.at(len - 1) != '/') |
1153 | target += '/'; | 1154 | target += '/'; |
1154 | #endif | 1155 | #endif |
1155 | 1156 | ||
1156 | QString base(""); | 1157 | QString base(""); |
1157 | uint i = 1; | 1158 | uint i = 1; |
1158 | 1159 | ||
1159 | while( i < len ) | 1160 | while( i < len ) |
1160 | { | 1161 | { |
1161 | //US struct stat st; | 1162 | //US struct stat st; |
1162 | #ifndef _WIN32_ | 1163 | #ifndef _WIN32_ |
1163 | int pos = target.find('/', i); | 1164 | int pos = target.find('/', i); |
1164 | #else | 1165 | #else |
1165 | int pos = target.find('\\', i); | 1166 | int pos = target.find('\\', i); |
1166 | #endif | 1167 | #endif |
1167 | if ( pos < 0 ) | 1168 | if ( pos < 0 ) |
1168 | return true; | 1169 | return true; |
1169 | base += target.mid(i - 1, pos - i + 1); | 1170 | base += target.mid(i - 1, pos - i + 1); |
1170 | //QMessageBox::information( 0,"cap111", base, 1 ); | 1171 | //QMessageBox::information( 0,"cap111", base, 1 ); |
1171 | /*US | 1172 | /*US |
1172 | QCString baseEncoded = QFile::encodeName(base); | 1173 | QCString baseEncoded = QFile::encodeName(base); |
1173 | // bail out if we encountered a problem | 1174 | // bail out if we encountered a problem |
1174 | if (stat(baseEncoded, &st) != 0) | 1175 | if (stat(baseEncoded, &st) != 0) |
1175 | { | 1176 | { |
1176 | // Directory does not exist.... | 1177 | // Directory does not exist.... |
1177 | // Or maybe a dangling symlink ? | 1178 | // Or maybe a dangling symlink ? |
1178 | if (lstat(baseEncoded, &st) == 0) | 1179 | if (lstat(baseEncoded, &st) == 0) |
1179 | (void)unlink(baseEncoded); // try removing | 1180 | (void)unlink(baseEncoded); // try removing |
1180 | 1181 | ||
1181 | 1182 | ||
1182 | if ( mkdir(baseEncoded, (mode_t) mode) != 0) { | 1183 | if ( mkdir(baseEncoded, (mode_t) mode) != 0) { |
1183 | perror("trying to create local folder"); | 1184 | perror("trying to create local folder"); |
1184 | return false; // Couldn't create it :-( | 1185 | return false; // Couldn't create it :-( |
1185 | } | 1186 | } |
1186 | } | 1187 | } |
1187 | */ | 1188 | */ |
1188 | 1189 | ||
1189 | if (dirObj.exists(base) == false) | 1190 | if (dirObj.exists(base) == false) |
1190 | { | 1191 | { |
1191 | //qDebug("KStandardDirs::makeDir try to create : %s" , base.latin1()); | 1192 | //qDebug("KStandardDirs::makeDir try to create : %s" , base.latin1()); |
1192 | if (dirObj.mkdir(base) != true) | 1193 | if (dirObj.mkdir(base) != true) |
1193 | { | 1194 | { |
1194 | qDebug("KStandardDirs::makeDir could not create: %s" , base.latin1()); | 1195 | qDebug("KStandardDirs::makeDir could not create: %s" , base.latin1()); |
1195 | return false; | 1196 | return false; |
1196 | } | 1197 | } |
1197 | } | 1198 | } |
1198 | 1199 | ||
1199 | i = pos + 1; | 1200 | i = pos + 1; |
1200 | } | 1201 | } |
1201 | return true; | 1202 | return true; |
1202 | 1203 | ||
1203 | } | 1204 | } |
1204 | 1205 | ||
1205 | static QString readEnvPath(const char *env) | 1206 | static QString readEnvPath(const char *env) |
1206 | { | 1207 | { |
1207 | #ifdef _WIN32_ | 1208 | //#ifdef _WIN32_ |
1208 | return ""; | 1209 | // return ""; |
1209 | #else | 1210 | //#else |
1210 | QCString c_path = getenv(env); | 1211 | QCString c_path; |
1211 | if (c_path.isEmpty()) | 1212 | if ( getenv(env) != NULL ) |
1212 | return QString::null; | 1213 | c_path = QString ( getenv(env) ); |
1213 | return QFile::decodeName(c_path); | 1214 | if (c_path.isEmpty()) |
1214 | #endif | 1215 | return QString::null; |
1216 | return QFile::decodeName(c_path); | ||
1217 | //#endif | ||
1218 | |||
1215 | } | 1219 | } |
1216 | 1220 | ||
1217 | void KStandardDirs::addKDEDefaults() | 1221 | void KStandardDirs::addKDEDefaults() |
1218 | { | 1222 | { |
1223 | |||
1219 | //qDebug("ERROR: KStandardDirs::addKDEDefaults() called "); | 1224 | //qDebug("ERROR: KStandardDirs::addKDEDefaults() called "); |
1220 | //return; | 1225 | //return; |
1221 | QStringList kdedirList; | 1226 | QStringList kdedirList; |
1222 | 1227 | ||
1223 | // begin KDEDIRS | 1228 | // begin KDEDIRS |
1224 | QString kdedirs = readEnvPath("MICROKDEDIRS"); | 1229 | QString kdedirs = readEnvPath("MICROKDEDIRS"); |
1225 | if (!kdedirs.isEmpty()) | 1230 | if (!kdedirs.isEmpty()) |
1226 | { | 1231 | { |
1227 | tokenize(kdedirList, kdedirs, ":"); | 1232 | tokenize(kdedirList, kdedirs, ":"); |
1228 | } | 1233 | } |
1229 | else | 1234 | else |
1230 | { | 1235 | { |
1231 | QString kdedir = readEnvPath("MICROKDEDIR"); | 1236 | QString kdedir = readEnvPath("MICROKDEDIR"); |
1232 | if (!kdedir.isEmpty()) | 1237 | if (!kdedir.isEmpty()) |
1233 | { | 1238 | { |
1234 | kdedir = KShell::tildeExpand(kdedir); | 1239 | kdedir = KShell::tildeExpand(kdedir); |
1235 | kdedirList.append(kdedir); | 1240 | kdedirList.append(kdedir); |
1236 | } | 1241 | } |
1237 | } | 1242 | } |
1238 | //US kdedirList.append(KDEDIR); | 1243 | //US kdedirList.append(KDEDIR); |
1239 | //US for embedded, add qtopia dir as kdedir | 1244 | //US for embedded, add qtopia dir as kdedir |
1240 | 1245 | ||
1241 | #ifndef DESKTOP_VERSION | 1246 | #ifndef DESKTOP_VERSION |
1242 | QString tmp = readEnvPath("QPEDIR"); | 1247 | QString tmp = readEnvPath("QPEDIR"); |
1243 | if (!tmp.isEmpty()) | 1248 | if (!tmp.isEmpty()) |
1244 | kdedirList.append(tmp); | 1249 | kdedirList.append(tmp); |
1245 | 1250 | ||
1246 | tmp = readEnvPath("QTDIR"); | 1251 | tmp = readEnvPath("QTDIR"); |
1247 | if (!tmp.isEmpty()) | 1252 | if (!tmp.isEmpty()) |
1248 | kdedirList.append(tmp); | 1253 | kdedirList.append(tmp); |
1249 | 1254 | ||
1250 | tmp = readEnvPath("OPIEDIR"); | 1255 | tmp = readEnvPath("OPIEDIR"); |
1251 | if (!tmp.isEmpty()) | 1256 | if (!tmp.isEmpty()) |
1252 | kdedirList.append(tmp); | 1257 | kdedirList.append(tmp); |
1253 | 1258 | ||
1254 | #endif | 1259 | #endif |
1255 | 1260 | ||
1256 | #ifdef __KDE_EXECPREFIX | 1261 | #ifdef __KDE_EXECPREFIX |
1257 | QString execPrefix(__KDE_EXECPREFIX); | 1262 | QString execPrefix(__KDE_EXECPREFIX); |
1258 | if (execPrefix!="NONE") | 1263 | if (execPrefix!="NONE") |
1259 | kdedirList.append(execPrefix); | 1264 | kdedirList.append(execPrefix); |
1260 | #endif | 1265 | #endif |
1261 | 1266 | ||
1262 | QString localKdeDir; | 1267 | QString localKdeDir; |
1263 | 1268 | ||
1264 | //US if (getuid()) | 1269 | //US if (getuid()) |
1265 | if (true) | 1270 | if (true) |
1266 | { | 1271 | { |
1267 | localKdeDir = readEnvPath("MICROKDEHOME"); | 1272 | localKdeDir = readEnvPath("MICROKDEHOME"); |
1268 | if (!localKdeDir.isEmpty()) | 1273 | if (!localKdeDir.isEmpty()) |
1269 | { | 1274 | { |
1275 | #ifdef _WIN32_ | ||
1276 | if (localKdeDir.at(localKdeDir.length()-1) != '\\') | ||
1277 | localKdeDir += '\\'; | ||
1278 | #else | ||
1270 | if (localKdeDir.at(localKdeDir.length()-1) != '/') | 1279 | if (localKdeDir.at(localKdeDir.length()-1) != '/') |
1271 | localKdeDir += '/'; | 1280 | localKdeDir += '/'; |
1281 | #endif | ||
1282 | //QMessageBox::information( 0,"localKdeDir",localKdeDir, 1 ); | ||
1272 | } | 1283 | } |
1273 | else | 1284 | else |
1274 | { | 1285 | { |
1275 | localKdeDir = QDir::homeDirPath() + "/kdepim/"; | 1286 | localKdeDir = QDir::homeDirPath() + "/kdepim/"; |
1276 | } | 1287 | } |
1277 | } | 1288 | } |
1278 | else | 1289 | else |
1279 | { | 1290 | { |
1280 | // We treat root different to prevent root messing up the | 1291 | // We treat root different to prevent root messing up the |
1281 | // file permissions in the users home directory. | 1292 | // file permissions in the users home directory. |
1282 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); | 1293 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); |
1283 | if (!localKdeDir.isEmpty()) | 1294 | if (!localKdeDir.isEmpty()) |
1284 | { | 1295 | { |
1285 | if (localKdeDir.at(localKdeDir.length()-1) != '/') | 1296 | if (localKdeDir.at(localKdeDir.length()-1) != '/') |
1286 | localKdeDir += '/'; | 1297 | localKdeDir += '/'; |
1287 | } | 1298 | } |
1288 | else | 1299 | else |
1289 | { | 1300 | { |
1290 | //US struct passwd *pw = getpwuid(0); | 1301 | //US struct passwd *pw = getpwuid(0); |
1291 | //US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; | 1302 | //US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; |
1292 | qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); | 1303 | qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); |
1293 | } | 1304 | } |
1294 | 1305 | ||
1295 | } | 1306 | } |
1296 | 1307 | ||
1297 | //US localKdeDir = appDir(); | 1308 | //US localKdeDir = appDir(); |
1298 | 1309 | ||
1299 | //US | 1310 | //US |
1300 | // qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); | 1311 | // qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); |
1301 | if (localKdeDir != "-/") | 1312 | if (localKdeDir != "-/") |
1302 | { | 1313 | { |
1303 | localKdeDir = KShell::tildeExpand(localKdeDir); | 1314 | localKdeDir = KShell::tildeExpand(localKdeDir); |
1304 | addPrefix(localKdeDir); | 1315 | addPrefix(localKdeDir); |
1305 | } | 1316 | } |
1306 | 1317 | ||
1307 | for (QStringList::ConstIterator it = kdedirList.begin(); | 1318 | for (QStringList::ConstIterator it = kdedirList.begin(); |
1308 | it != kdedirList.end(); it++) | 1319 | it != kdedirList.end(); it++) |
1309 | { | 1320 | { |
1310 | QString dir = KShell::tildeExpand(*it); | 1321 | QString dir = KShell::tildeExpand(*it); |
1311 | addPrefix(dir); | 1322 | addPrefix(dir); |
1312 | } | 1323 | } |
1313 | // end KDEDIRS | 1324 | // end KDEDIRS |
1314 | 1325 | ||
1315 | // begin XDG_CONFIG_XXX | 1326 | // begin XDG_CONFIG_XXX |
1316 | QStringList xdgdirList; | 1327 | QStringList xdgdirList; |
1317 | QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS"); | 1328 | QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS"); |
1318 | if (!xdgdirs.isEmpty()) | 1329 | if (!xdgdirs.isEmpty()) |
1319 | { | 1330 | { |
1320 | tokenize(xdgdirList, xdgdirs, ":"); | 1331 | tokenize(xdgdirList, xdgdirs, ":"); |
1321 | } | 1332 | } |
1322 | else | 1333 | else |
1323 | { | 1334 | { |
1324 | xdgdirList.clear(); | 1335 | xdgdirList.clear(); |
1325 | xdgdirList.append("/etc/xdg"); | 1336 | xdgdirList.append("/etc/xdg"); |
1326 | } | 1337 | } |
1327 | 1338 | ||
1328 | QString localXdgDir = readEnvPath("XDG_CONFIG_HOME"); | 1339 | QString localXdgDir = readEnvPath("XDG_CONFIG_HOME"); |
1329 | if (!localXdgDir.isEmpty()) | 1340 | if (!localXdgDir.isEmpty()) |
1330 | { | 1341 | { |
1331 | if (localXdgDir.at(localXdgDir.length()-1) != '/') | 1342 | if (localXdgDir.at(localXdgDir.length()-1) != '/') |
1332 | localXdgDir += '/'; | 1343 | localXdgDir += '/'; |
1333 | } | 1344 | } |
1334 | else | 1345 | else |
1335 | { | 1346 | { |