summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kofilterview.cpp7
-rw-r--r--korganizer/koprefs.cpp8
-rw-r--r--korganizer/mainwindow.cpp6
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
@@ -9,48 +9,49 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
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>
KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent,
const char* name,WFlags fl )
: KOFilterView_base(parent,name,fl)
{
mFilters = filterList;
connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged()));
connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged()));
@@ -386,58 +387,58 @@ void KOCalEditView::addCal()
if ( kkf->mName == name ) {
KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) );
name = "";
tryagain = true;
break;
}
if ( kkf->mFileName == file ) {
KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) );
tryagain = true;
file = KGlobalSettings::calendarDir()+"newCal.ics";
break;
}
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 ) ) {
KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) );
return 0;
}
QTextStream tsIn( &fileIn );
tsIn.setCodec( QTextCodec::codecForName("utf8") );
tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n";
fileIn.close();
}
KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar();
kkf->mName = name;
kkf->mFileName = absFile;
kkf->mSavedFileName = file;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index eb997f5..77f572c 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -428,72 +428,72 @@ void KOPrefs::usrReadConfig()
mTodoSummaryUser = getDefaultList() ;
}
if (mCustomCategories.isEmpty()) setCategoryDefaults();
config()->setGroup("Personal Settings");
mName = config()->readEntry("user_name","");
mEmail = config()->readEntry("user_email","");
fillMailDefaults();
config()->setGroup("Category Colors");
QStringList::Iterator it;
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()
{
KopiCalendarFile * kkf = new KopiCalendarFile();
kkf->mCalNumber = mNextAvailableCalendar;
mDefCalColors.resize( mNextAvailableCalendar );
mDefCalColors[mNextAvailableCalendar-1] = kkf;
++mNextAvailableCalendar;
kkf->mDefaultColor = mEventColor;
kkf->mName = i18n("New Calendar");
mCalendars.append( kkf );
return kkf;
}
void KOPrefs::deleteCalendar( int num )
{
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 9c55e9f..9ae393d 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1671,54 +1671,54 @@ void MainWindow::aboutAutoSaving()
KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
}
void MainWindow::aboutKnownBugs()
{
QMessageBox* msg;
msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
i18n("\nor report them in the bugtracker on\n") +
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 );
p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
p.end();
QIconSet icon3 ( mWeekPixmap );
mWeekAction->setIconSet ( icon3 );
}
void MainWindow::updateWeekNum(const DateList &selectedDates)
{
updateWeek( selectedDates.first() );
}
void MainWindow::processIncidenceSelection( Incidence *incidence )
{
@@ -2544,49 +2544,49 @@ void MainWindow::exportVCalendar()
if ( info. exists() ) {
mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
i18n("Overwrite!"), i18n("Cancel"), 0,
0, 1 );
if ( result != 0 ) {
createbup = false;
}
}
if ( createbup ) {
if ( mView->exportVCalendar( fn ) ) {
KOPrefs::instance()->mLastVcalFile = fn;
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);
if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
mSyncManager->slotSyncMenu( 999 );
}
setCaption(i18n("Saving Data to temp file ..." ));
mView->saveCalendar( sentSyncFile() );
setCaption(i18n("Data saved to temp file!" ));
mSyncManager->setBlockSave( false );
}
void MainWindow::getFile( bool success )
{