-rw-r--r-- | korganizer/kofilterview.cpp | 7 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 8 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 6 |
3 files changed, 11 insertions, 10 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index e86ec95..ef25fd0 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -21,24 +21,25 @@ without including the source code for Qt in the source distribution. */ #include <qcheckbox.h> #include <qcombobox.h> #include <qpushbutton.h> #include <qlayout.h> #include <qlabel.h> #include <qdialog.h> #include <qtextstream.h> #include <qtextcodec.h> #include <qwhatsthis.h> +#include <qdir.h> #include <libkcal/calfilter.h> #include "kofilterview.h" #include "koprefs.h" #include <kiconloader.h> #include <kglobal.h> #include <kglobalsettings.h> #include <kcolorbutton.h> #include <kmessagebox.h> @@ -398,34 +399,34 @@ void KOCalEditView::addCal() kkf = KOPrefs::instance()->mCalendars.next(); } QFileInfo fi ( file ); if ( fi.isDir() ) { tryagain = true; } } addCalendar ( name, file ); QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); } int KOCalEditView::addCalendar( QString name, QString file, bool ask ) { - + file = QDir::convertSeparators( file ); QFileInfo fi ( file ); QString absFile = file; bool isRelative = false; if ( fi.isRelative() ) { isRelative = true; - absFile = KGlobalSettings::calendarDir()+file; + absFile = QDir::convertSeparators( KGlobalSettings::calendarDir()+file ); fi.setFile( absFile ); } else { - QString cd = KGlobalSettings::calendarDir(); + QString cd = QDir::convertSeparators( KGlobalSettings::calendarDir() ); if ( file.left( cd.length() ) == cd ) { isRelative = true; file = fi.fileName (); fi.setFile( absFile ); } } if (!fi.exists() ) { if ( ask ) if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( KGlobal::formatMessage (absFile,0) ) )== KMessageBox::No ) return 0; QFile fileIn( absFile ); if (!fileIn.open( IO_WriteOnly ) ) { diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index eb997f5..77f572c 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -440,48 +440,48 @@ void KOPrefs::usrReadConfig() for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); } KConfig fc (locateLocal("config","kopicalendarrc")); fc.setGroup("CC"); int numCals = fc.readNumEntry("NumberCalendars",0 ); mNextAvailableCalendar = 1; if ( numCals == 0 ) { KopiCalendarFile *kkf = getNewCalendar(); kkf->isStandard = true; kkf->mName = i18n("Standard"); - kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); + kkf->mFileName = QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) ); } while ( mNextAvailableCalendar <= numCals ) { //qDebug("Read cal #%d ", mNextAvailableCalendar ); QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); KopiCalendarFile *kkf = getNewCalendar(); kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); - kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); - kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName); + kkf->mFileName = QDir::convertSeparators( fc.readEntry( prefix+"_FileName", kkf->mFileName) ); + kkf->mSavedFileName = QDir::convertSeparators( fc.readEntry( prefix+"_SavedFileName", kkf->mFileName) ); kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); if ( kkf->mCalNumber == 1 ) { kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); } //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); if ( kkf->mName == i18n("Birthdays") ) { kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); } if ( kkf->isRelative ) - kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName; + kkf->mFileName = QDir::convertSeparators( KGlobalSettings::calendarDir() + kkf->mSavedFileName ); } KPimPrefs::usrReadConfig(); } KopiCalendarFile * KOPrefs::getCalendar( int num ) { return mDefCalColors[num-1]; } KopiCalendarFile * KOPrefs::getNewCalendar() { diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 9c55e9f..9ae393d 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1683,30 +1683,30 @@ void MainWindow::aboutKnownBugs() i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), QMessageBox::NoIcon, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); msg->exec(); delete msg; } QString MainWindow::defaultFileName() { - return locateLocal( "data", "korganizer/mycalendar.ics" ); + return QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) ); } QString MainWindow::syncFileName() { #ifdef DESKTOP_VERSION - return locateLocal( "tmp", "synccalendar.ics" ); + return QDir::convertSeparators( locateLocal( "tmp", "synccalendar.ics" ) ); #else return QString( "/tmp/synccalendar.ics" ); #endif } #include "koglobals.h" #include <kcalendarsystem.h> void MainWindow::updateWeek(QDate seda) { int weekNum = KGlobal::locale()->weekNum ( seda ); mWeekPixmap.fill( mWeekBgColor ); QPainter p ( &mWeekPixmap ); p.setFont( mWeekFont ); @@ -2556,25 +2556,25 @@ void MainWindow::exportVCalendar() if ( fn.length() > 20 ) mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; else mes = i18n("KO/Pi:Exported to %1").arg(fn ); setCaption(mes); } } } QString MainWindow::sentSyncFile() { #ifdef DESKTOP_VERSION - return locateLocal( "tmp", "copysynccal.ics" ); + return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) ); #else return QString( "/tmp/copysynccal.ics" ); #endif } void MainWindow::syncFileRequest() { while ( mSyncManager->blockSave() ) { qApp->processEvents(); } mSyncManager->setBlockSave(true); |