-rw-r--r-- | korganizer/mainwindow.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index b6ce7d5..b797d8c 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -129,34 +129,31 @@ public: QCheckBox* mWriteBackFuture; QSpinBox* mWriteBackFutureWeeks; }; QPixmap* sgListViewCompletedPix[6]; int globalFlagBlockStartup; -MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : +MainWindow::MainWindow( QWidget *parent, const char *name ) : QMainWindow( parent, name ) { sgListViewCompletedPix[5] = &listviewPix; sgListViewCompletedPix[0] = &listviewPix0; sgListViewCompletedPix[1] = &listviewPix20; sgListViewCompletedPix[2] = &listviewPix40; sgListViewCompletedPix[3] = &listviewPix60; sgListViewCompletedPix[4] = &listviewPix80; if ( sgListViewCompletedPix[5]->height() < 5 ) { - int size = 12; + //int size = 12; sgListViewCompletedPix[5]->resize( 11, 11 ); sgListViewCompletedPix[5]->fill( Qt::white ); QPainter p ( sgListViewCompletedPix[5] ); p.drawRect( 0,0,11,11); - int half = size/2; - int heihei = size/2; - int x = 1; p.drawLine ( 2, 5, 4 , 7 ) ; p.drawLine ( 4 , 7 , 8, 3) ; int iii = 0; for ( iii = 0; iii < 5; ++iii ) { sgListViewCompletedPix[iii]->resize( 11, 11 ); sgListViewCompletedPix[iii]->fill( Qt::white ); QPainter p ( sgListViewCompletedPix[iii] ); p.drawRect( 0,0,11,11); @@ -339,17 +336,16 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : QTime neededSaveTime = QDateTime::currentDateTime().time(); mView->loadCalendars(); int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); qDebug("KO: Calendar loading time: %d ms",msNeeded ); if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { KOPrefs::instance()->setAllDefaults(); - int count = mView->addCategories(); } processIncidenceSelection( 0 ); connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), SLOT( processIncidenceSelection( Incidence * ) ) ); connect( mView, SIGNAL( modifiedChanged( bool ) ), SLOT( slotModifiedChanged( bool ) ) ); @@ -1850,21 +1846,21 @@ void MainWindow::saveOnClose() p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; if ( filterToolBar ) { if ( p->mToolBarHorF ) p->mToolBarUpF = filterToolBar->y() > height()/2; else p->mToolBarUpF = filterToolBar->x() > width()/2 ; } #endif - save(); mView->writeSettings(); + mView->checkSuspendAlarm(); } -void MainWindow::slotModifiedChanged( bool changed ) +void MainWindow::slotModifiedChanged( bool ) { if ( mBlockAtStartup ) return; int msec; // we store the changes after 1 minute, // and for safety reasons after 10 minutes again if ( !mSyncManager->blockSave() ) @@ -1898,17 +1894,17 @@ void MainWindow::backupAllFiles() } else if ( retval == 1 ){ qDebug("KO: Backup created."); // backup ok QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); cal = calendars.next(); while ( cal ) { if ( !cal->mErrorOnLoad ) { - int retval = KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); + KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); } cal = calendars.next(); } KOPrefs::instance()->mLastBackupDate = daysTo; setCaption(i18n("Backup succesfully finished" )); } else if ( retval == 2 ){ setCaption(i18n("Backup globally disabled" )); qDebug("KO: Backup globally cancelled."); @@ -2403,20 +2399,19 @@ void MainWindow::quickImportIcal() { importFile( KOPrefs::instance()->mLastImportFile, false ); } void MainWindow::importFile( QString fn, bool quick ) { QFileInfo info; info.setFile( fn ); QString mess; - bool loadbup = true; if ( !info. exists() ) { mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); - int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), + QMessageBox::warning( this, i18n("KO/Pi: Warning!"), mess ); return; } int result = 0; if ( !quick ) { mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); result = QMessageBox::warning( this, "KO/Pi: Warning!", mess, |