-rw-r--r-- | korganizer/calendarview.cpp | 11 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 2 | ||||
-rw-r--r-- | microkde/kfiledialog.cpp | 11 | ||||
-rw-r--r-- | microkde/kfiledialog.h | 2 | ||||
-rw-r--r-- | microkde/kio/kfile/kurlrequester.cpp | 7 | ||||
-rw-r--r-- | microkde/kio/kfile/kurlrequester.h | 2 |
6 files changed, 30 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 4b82aa8..8f5de4d 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -639,19 +639,21 @@ CalendarView::~CalendarView() } void CalendarView::checkAlarms() { KConfig *config = KOGlobals::config(); config->setGroup( "AppRun" ); QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); int secto = dt.secsTo( QDateTime::currentDateTime() ); int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30; + qDebug("KO: Reading program stop %d ", secs); //secs -= ( 3600 * 24*3 ); // debug only QDateTime latest = dt.addSecs ( secs ); qDebug("KO: Last termination on %s ", latest.toString().latin1()); + qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); QPtrList<Incidence> el = mCalendar->rawIncidences(); QPtrList<Incidence> al; Incidence* inL = el.first(); QDateTime cur = QDateTime::currentDateTime().addSecs(-59); qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); while ( inL ) { bool ok = false; int offset = 0; @@ -2151,18 +2153,23 @@ void CalendarView::writeSettings() mViewManager->writeSettings( config ); mTodoList->saveLayout(config,QString("Todo Layout")); mDialogManager->writeSettings( config ); //KOPrefs::instance()->usrWriteConfig(); KOPrefs::instance()->writeConfig(); writeFilterSettings(config); config->setGroup( "AppRun" ); - QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); - config->writeEntry( "LatestProgramStop", dt.secsTo( QDateTime::currentDateTime() ) ); + QDateTime dt ( QDate (2005,3,1), QTime( 0,0,0 ) ); + int secs = dt.secsTo( QDateTime::currentDateTime() ); + config->writeEntry( "LatestProgramStop", secs ); + qDebug("KO: Writing stop time: %d ", secs); + qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); + QDateTime latest = dt.addSecs ( secs ); + qDebug("KO: Test termination on %s ", latest.toString().latin1()); config->setGroup( "Views" ); config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); QValueList<int> listINT = mLeftFrame->sizes(); config->writeEntry("Left Splitter Frame",listINT); QValueList<int> listINT2 = mMainFrame->sizes(); config->writeEntry("Main Splitter Frame",listINT2); #ifdef DESKTOP_VERSION diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index d3797ae..a0f9d2e 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp @@ -130,16 +130,17 @@ void KDEPIMConfigWidget::setupBackupTab() QWidget* bupFrame = new QWidget( topFrame ); topLayout->addWidget((bupFrame)); QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); sb = addWidBool(i18n("Use standard backup dir"), &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); bupLayout->addWidget((QWidget*)sb->checkBox()); mBackupUrl = new KURLRequester( bupFrame ); + mBackupUrl->setPathIsDir(); mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); bupLayout->addWidget( mBackupUrl ); mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); QHBox *dummy = new QHBox(bupFrame); new QLabel(i18n("Number of Backups:"),dummy); @@ -176,16 +177,17 @@ void KDEPIMConfigWidget::setupStoreTab() topLayout->addWidget( (QWidget* )holidayColor->button()); QVBox *storePage = new QVBox( this ); if ( QApplication::desktop()->height() > 240 ) new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); mStoreUrl = new KURLRequester( storePage ); + mStoreUrl->setPathIsDir(); mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); #ifdef DESKTOP_VERSION QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; QFileInfo fi ( confFile ); if ( fi.exists() ) { KConfig cfg ( confFile ); cfg.setGroup("Global"); QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 6be1580..c64f325 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp @@ -54,26 +54,35 @@ QString KFileDialog::getOpenFileName( const QString & fn, lay.addWidget( &o); dia.showMaximized(); dia.setCaption( cap ); int res = dia.exec(); if ( res ) retfile = o.selectedName(); return retfile; } - +QString KFileDialog::getExistingDirectory( const QString & fn, + const QString & cap, QWidget * par ) +{ + return KFileDialog::getSaveFileName( fn, cap, pr ); +} #else #include <qfiledialog.h> QString KFileDialog::getSaveFileName( const QString & fn, const QString & cap , QWidget * par ) { return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); } QString KFileDialog::getOpenFileName( const QString & fn, const QString & cap, QWidget * par ) { return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); } +QString KFileDialog::getExistingDirectory( const QString & fn, + const QString & cap, QWidget * par ) +{ + return QFileDialog::getExistingDirectory( fn, par, "exidtingdir", cap ); +} #endif diff --git a/microkde/kfiledialog.h b/microkde/kfiledialog.h index 0825872..90709cd 100644 --- a/microkde/kfiledialog.h +++ b/microkde/kfiledialog.h @@ -10,11 +10,13 @@ class KFileDialog static QString getSaveFileName( const QString &, const QString &, QWidget * ); static QString getOpenFileName( const QString &, const QString &, QWidget * ); + static QString getExistingDirectory( const QString &, + const QString &, QWidget * ); }; #endif diff --git a/microkde/kio/kfile/kurlrequester.cpp b/microkde/kio/kfile/kurlrequester.cpp index 991c8be..ca94570 100644 --- a/microkde/kio/kfile/kurlrequester.cpp +++ b/microkde/kio/kfile/kurlrequester.cpp @@ -206,17 +206,17 @@ KURLRequester::~KURLRequester() delete d; } void KURLRequester::init() { myFileDialog = 0L; myShowLocalProt = false; - + mPathIsDir = false; if (/*US !d->combo && */ !d->edit ) d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" ); myButton = new KURLDragPushButton( this, "kfile button"); QIconSet iconSet = SmallIconSet("fileopen"); QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal ); myButton->setIconSet( iconSet ); myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 ); @@ -267,17 +267,20 @@ QString KURLRequester::url() const void KURLRequester::slotOpenDialog() { emit openFileDialog( this ); //US use our special KFIleDialog instead KURL u( url() ); //QString fn = u.url(); QString fn = d->edit->text(); - fn = KFileDialog::getSaveFileName( fn, "", this ); + if ( mPathIsDir ) + fn = KFileDialog::getExistingDirectory ( fn, "", this ); + else + fn = KFileDialog::getSaveFileName( fn, "", this ); if ( fn == "" ) return; setURL( fn ); emit urlSelected( d->url() ); /*US KFileDialog *dlg = fileDialog(); diff --git a/microkde/kio/kfile/kurlrequester.h b/microkde/kio/kfile/kurlrequester.h index 3253dd5..faa3326 100644 --- a/microkde/kio/kfile/kurlrequester.h +++ b/microkde/kio/kfile/kurlrequester.h @@ -100,16 +100,17 @@ public: /** * Sets the mode of the file dialog. * Note: you can only select one file with the filedialog, * so KFile::Files doesn't make much sense. * @see KFileDialog::setMode() */ void setMode( unsigned int m ); + void setPathIsDir( ) {mPathIsDir = true;} /** * Sets the filter for the file dialog. * @see KFileDialog::setFilter() */ void setFilter( const QString& filter ); /** @@ -229,16 +230,17 @@ protected: //US KURLCompletion * myCompletion; private: KURLDragPushButton * myButton; bool myShowLocalProt; mutable KFileDialog * myFileDialog; + bool mPathIsDir; protected slots: /** * Called when the button is pressed to open the filedialog. * Also called when @ref KStdAccel::Open (default is Ctrl-O) is pressed. */ void slotOpenDialog(); |