summaryrefslogtreecommitdiffabout
path: root/korganizer/ktimeedit.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/ktimeedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/ktimeedit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp
index cf07a1a..f5a1c50 100644
--- a/korganizer/ktimeedit.cpp
+++ b/korganizer/ktimeedit.cpp
@@ -26,16 +26,17 @@
#include <qdatetime.h>
#include <qlineedit.h>
#include <qapplication.h>
#include <kmessagebox.h>
#include <kglobal.h>
#include <kdebug.h>
#include <klocale.h>
+#include <kpimglobalprefs.h>
#include "ktimeedit.h"
#include "koprefs.h"
#include <qvalidator.h>
// Validator for a time value with only hours and minutes (no seconds)
// Mostly locale aware. Author: David Faure <faure@kde.org>
class KOTimeValidator : public QValidator
@@ -106,17 +107,17 @@ KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name)
updateText();
setFocusPolicy(QWidget::StrongFocus);
connect(this, SIGNAL(activated(int)), this, SLOT(activ(int)));
connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int)));
connect(this,SIGNAL(textChanged(const QString&)),this,SLOT(changedText()));
QFontMetrics fm ( font() );
QString timeString = "24:00";
- if ( KOPrefs::instance()->mPreferredTime == 1 )
+ if ( KPimGlobalPrefs::instance()->mPreferredTime == 1 )
timeString = "02:00pm";
int addSpace = 32;
if ( QApplication::desktop()->width() > 320 )
timeString += ":00";
setFixedWidth(fm.width( timeString ) + 32 );
// Highlight Background and Textcolor change from default
QPalette palette = QWidget::palette();
@@ -233,17 +234,17 @@ void KOTimeEdit::setSelect( int from, int to )
lineEdit()->setSelection( from , to );
}
void KOTimeEdit::keyPressEvent(QKeyEvent *e)
{
qApp->processEvents();
- bool hour12Format = ( KOPrefs::instance()->mPreferredTime == 1 );
+ bool hour12Format = ( KPimGlobalPrefs::instance()->mPreferredTime == 1 );
int maxpos = hour12Format?7:5;
if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
e->ignore();
// qDebug(" ignore %d",e->isAutoRepeat() );
return;
}
if (! e->isAutoRepeat() ) {
mFlagKeyPressed = true;