summaryrefslogtreecommitdiffabout
path: root/microkde/kglobalsettings.cpp
Unidiff
Diffstat (limited to 'microkde/kglobalsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kglobalsettings.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp
index 3f8a630..2e483e9 100644
--- a/microkde/kglobalsettings.cpp
+++ b/microkde/kglobalsettings.cpp
@@ -18,87 +18,96 @@ QFont KGlobalSettings::generalFont()
18 if (QApplication::desktop()->width() < 480 ) { 18 if (QApplication::desktop()->width() < 480 ) {
19 size = 10; 19 size = 10;
20 } 20 }
21#ifndef DESKTOP_VERSION 21#ifndef DESKTOP_VERSION
22 else 22 else
23 if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 23 if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
24 size = 18; 24 size = 18;
25#endif 25#endif
26 QFont f = QApplication::font(); 26 QFont f = QApplication::font();
27 //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); 27 //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1());
28 f.setPointSize( size ); 28 f.setPointSize( size );
29 return f; 29 return f;
30} 30}
31QFont KGlobalSettings::generalMaxFont() 31QFont KGlobalSettings::generalMaxFont()
32{ 32{
33 int size = 12; 33 int size = 12;
34 if (QApplication::desktop()->width() < 480 ) { 34 if (QApplication::desktop()->width() < 480 ) {
35 size = 10; 35 size = 10;
36 } 36 }
37#ifndef DESKTOP_VERSION 37#ifndef DESKTOP_VERSION
38 else 38 else
39 if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 39 if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
40 size = 18; 40 size = 18;
41#endif 41#endif
42 QFont f = QApplication::font(); 42 QFont f = QApplication::font();
43 if ( f.pointSize() > size ) 43 if ( f.pointSize() > size )
44 f.setPointSize( size ); 44 f.setPointSize( size );
45 return f; 45 return f;
46} 46}
47 47
48QString KGlobalSettings::timeTrackerDir() 48QString KGlobalSettings::timeTrackerDir()
49{ 49{
50 static QString dir; 50 static QString dir;
51 if ( dir.isEmpty() ) { 51 if ( dir.isEmpty() ) {
52 dir = locateLocal( "data", "timetrackerdir/d.ttl" ); 52 dir = locateLocal( "data", "timetrackerdir/d.ttl" );
53 dir = dir.left ( dir.length() - 5); 53 dir = dir.left ( dir.length() - 5);
54 } 54 }
55 return dir; 55 return dir;
56} 56}
57QString KGlobalSettings::backupDataDir() 57QString KGlobalSettings::backupDataDir()
58{ 58{
59 static QString dir; 59 static QString dir;
60 if ( dir.isEmpty() ) { 60 if ( dir.isEmpty() ) {
61 dir = locateLocal( "data", "backupdir/d.ttl" ); 61 dir = locateLocal( "data", "backupdir/d.ttl" );
62 dir = dir.left ( dir.length() - 5); 62 dir = dir.left ( dir.length() - 5);
63 } 63 }
64 return dir; 64 return dir;
65} 65}
66QString KGlobalSettings::calendarDir()
67{
68 static QString dir;
69 if ( dir.isEmpty() ) {
70 dir = locateLocal( "data", "korganizer/d.ttl" );
71 dir = dir.left ( dir.length() - 5);
72 }
73 return dir;
74}
66 75
67QFont KGlobalSettings::toolBarFont() 76QFont KGlobalSettings::toolBarFont()
68{ 77{
69 return QApplication::font(); 78 return QApplication::font();
70} 79}
71 80
72QColor KGlobalSettings::toolBarHighlightColor() 81QColor KGlobalSettings::toolBarHighlightColor()
73{ 82{
74 return QColor( "black" ); 83 return QColor( "black" );
75} 84}
76 85
77QColor KGlobalSettings::alternateBackgroundColor() 86QColor KGlobalSettings::alternateBackgroundColor()
78{ 87{
79 return mAlternate; 88 return mAlternate;
80 89
81} 90}
82void KGlobalSettings::setAlternateBackgroundColor(QColor c) 91void KGlobalSettings::setAlternateBackgroundColor(QColor c)
83{ 92{
84 mAlternate = c; 93 mAlternate = c;
85 94
86} 95}
87 96
88QRect KGlobalSettings::desktopGeometry( QWidget * ) 97QRect KGlobalSettings::desktopGeometry( QWidget * )
89{ 98{
90 return QApplication::desktop()->rect(); 99 return QApplication::desktop()->rect();
91} 100}
92 101
93 /** 102 /**
94 * Returns whether KDE runs in single (default) or double click 103 * Returns whether KDE runs in single (default) or double click
95 * mode. 104 * mode.
96 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html 105 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html
97 * @return true if single click mode, or false if double click mode. 106 * @return true if single click mode, or false if double click mode.
98 **/ 107 **/
99bool KGlobalSettings::singleClick() 108bool KGlobalSettings::singleClick()
100{ 109{
101 KConfig *c = KGlobal::config(); 110 KConfig *c = KGlobal::config();
102 KConfigGroupSaver cgs( c, "KDE" ); 111 KConfigGroupSaver cgs( c, "KDE" );
103 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); 112 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK);
104} 113}