[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-maemo
Subject:    Remaining Maemo5 platform hacks
From:       Volker Krause <vkrause () kde ! org>
Date:       2010-07-13 7:26:17
Message-ID: 201007130926.24363.vkrause () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


Hi,

I merged most of the platform integration changes we had in the komo kdelibs 
branch into kdelibs trunk yesterday. What's left is in the attached patch, 
all stuff that's too dirty for upstream. Any suggestions on how to do this in 
a nicer way?

The diff contains the following three changes:
- use native color and font settings
- use native file dialogs in KUrlRequester
- fix size of clear button in KLineEdit

regards
Volker

["maemo5-hacks.diff" (text/x-diff)]

Index: kio/kfile/kurlrequester.cpp
===================================================================
--- kio/kfile/kurlrequester.cpp	(revision 1149059)
+++ kio/kfile/kurlrequester.cpp	(working copy)
@@ -342,6 +342,20 @@
     {
         emit m_parent->openFileDialog( m_parent );
 
+#ifdef Q_WS_MAEMO_5
+	// ### ugly, but should give us native file dialogs in most cases
+        if ( !myFileDialog && fileDialogModality != Qt::NonModal ) {
+            const KUrl openUrl = (!m_parent->url().isEmpty() && \
!m_parent->url().isRelative()) ? +                m_parent->url() : m_startDir;
+            const KUrl newurl = KFileDialog::getOpenUrl( openUrl, QString(), \
m_parent ); +            if ( newurl.isValid() )
+            {
+                m_parent->setUrl( newurl );
+                emit m_parent->urlSelected( url() );
+            }
+	    return;
+	}
+#endif
         //Creates the fileDialog if it doesn't exist yet
         KFileDialog *dlg = m_parent->fileDialog();
 
Index: kdeui/kernel/kglobalsettings.cpp
===================================================================
--- kdeui/kernel/kglobalsettings.cpp	(revision 1149059)
+++ kdeui/kernel/kglobalsettings.cpp	(working copy)
@@ -984,6 +984,7 @@
 
 void KGlobalSettings::Private::kdisplaySetPalette()
 {
+#ifndef Q_WS_MAEMO_5
     // Added by Sam/Harald (TT) for Mac OS X initially, but why?
     KConfigGroup cg( KGlobal::config(), "General" );
     if (cg.readEntry("nopaletteChange", false))
@@ -994,11 +995,13 @@
     }
     emit q->kdisplayPaletteChanged();
     emit q->appearanceChanged();
+#endif
 }
 
 
 void KGlobalSettings::Private::kdisplaySetFont()
 {
+#ifndef Q_WS_MAEMO_5
     if (qApp->type() == QApplication::GuiClient) {
         KGlobalSettingsData* data = KGlobalSettingsData::self();
 
@@ -1011,6 +1014,7 @@
     }
     emit q->kdisplayFontChanged();
     emit q->appearanceChanged();
+#endif
 }
 
 
Index: kdeui/widgets/klineedit.cpp
===================================================================
--- kdeui/widgets/klineedit.cpp	(revision 1149059)
+++ kdeui/widgets/klineedit.cpp	(working copy)
@@ -326,10 +326,16 @@
         return;
     }
 
+#ifndef Q_WS_MAEMO_5
+    const int minIconSize = 0;
+#else
+    const int minIconSize = 48;
+#endif
+
     if (layoutDirection() == Qt::LeftToRight) {
-        d->clearButton->setPixmap(SmallIcon("edit-clear-locationbar-rtl", 0, \
clearButtonState)); +        \
d->clearButton->setPixmap(SmallIcon("edit-clear-locationbar-rtl", minIconSize, \
clearButtonState));  } else {
-        d->clearButton->setPixmap(SmallIcon("edit-clear-locationbar-ltr", 0, \
clearButtonState)); +        \
d->clearButton->setPixmap(SmallIcon("edit-clear-locationbar-ltr", minIconSize, \
clearButtonState));  }
 
     d->clearButton->setVisible(text.length());


["signature.asc" (application/pgp-signature)]

_______________________________________________
Kde-mobile mailing list
Kde-mobile@kde.org
https://mail.kde.org/mailman/listinfo/kde-mobile


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic