~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to debian/patches/kubuntu-message-indicator/0008-Make-dependency-on-libindicate-qt-optional.diff

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2009-09-24 15:36:10 UTC
  • Revision ID: james.westby@ubuntu.com-20090924153610-pllcvgprrq6bo71y
Tags: 4:4.3.1-0ubuntu4
Update debian/patches/kubuntu-message-indicator with 20090924
versions from
http://people.canonical.com/~agateau/indicate/index.html

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From c99a02dc2bd7d81ee601f37894b87c4bedb27428 Mon Sep 17 00:00:00 2001
 
2
From: Aurelien Gateau <aurelien.gateau@canonical.com>
 
3
Date: Thu, 24 Sep 2009 13:42:12 +0200
 
4
Subject: [PATCH 8/8] Make dependency on libindicate-qt optional.
 
5
 
 
6
---
 
7
 kmail/CMakeLists.txt       |   14 ++++++++++----
 
8
 kmail/config-kmail.h.cmake |    2 ++
 
9
 kmail/configuredialog.cpp  |   10 ++++++++++
 
10
 kmail/kmfolder.cpp         |    9 +++++++++
 
11
 kmail/kmkernel.cpp         |    6 ++++++
 
12
 5 files changed, 37 insertions(+), 4 deletions(-)
 
13
 
 
14
diff --git a/kmail/CMakeLists.txt b/kmail/CMakeLists.txt
 
15
index 7203020..190ca23 100644
 
16
--- a/kmail/CMakeLists.txt
 
17
+++ b/kmail/CMakeLists.txt
 
18
@@ -12,9 +12,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${KDE4_DATA_DIR}/cmake/modules)
 
19
 
 
20
 # indicate-qt
 
21
 find_package(PkgConfig REQUIRED)
 
22
-pkg_check_modules(INDICATEQT REQUIRED indicate-qt)
 
23
-include_directories(${INDICATEQT_INCLUDE_DIRS})
 
24
-link_directories(${INDICATEQT_LIBRARY_DIRS})
 
25
+pkg_check_modules(INDICATEQT indicate-qt>=0.2.1)
 
26
+macro_log_feature(INDICATEQT_FOUND "indicate-qt" "Qt bindings for libindicate" "http://launchpad.net/libindicate-qt" FALSE "0.2.1" "Required for indicators support in KMail.")
 
27
+if(INDICATEQT_FOUND)
 
28
+  include_directories(${INDICATEQT_INCLUDE_DIRS})
 
29
+  link_directories(${INDICATEQT_LIBRARY_DIRS})
 
30
+endif(INDICATEQT_FOUND)
 
31
 
 
32
 # Support for the SVN revision number in version-kmail.h
 
33
 if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
 
34
@@ -381,9 +384,12 @@ target_link_libraries(kmailprivate
 
35
   ${KDEPIMLIBS_KPIMUTILS_LIBS}
 
36
   ${KDEPIMLIBS_KPIMTEXTEDIT_LIBS}
 
37
   ${QT_QT3SUPPORT_LIBRARY}
 
38
-  ${INDICATEQT_LIBRARIES}
 
39
 )
 
40
 
 
41
+if(INDICATEQT_FOUND)
 
42
+  target_link_libraries(kmailprivate ${INDICATEQT_LIBRARIES})
 
43
+endif(INDICATEQT_FOUND)
 
44
+
 
45
 if(KMAIL_SQLITE_INDEX)
 
46
   target_link_libraries(kmailprivate ${SQLITE_LIBRARIES})
 
47
 endif(KMAIL_SQLITE_INDEX)
 
48
diff --git a/kmail/config-kmail.h.cmake b/kmail/config-kmail.h.cmake
 
49
index 48fea90..a4785d8 100644
 
50
--- a/kmail/config-kmail.h.cmake
 
51
+++ b/kmail/config-kmail.h.cmake
 
52
@@ -14,3 +14,5 @@
 
53
 #cmakedefine HAVE_MMAP 1
 
54
 
 
55
 #cmakedefine KDEPIM_FOLDEROPEN_PROFILE 1
 
56
+
 
57
+#cmakedefine INDICATEQT_FOUND 1
 
58
diff --git a/kmail/configuredialog.cpp b/kmail/configuredialog.cpp
 
59
index d6d6872..6f89bf5 100644
 
60
--- a/kmail/configuredialog.cpp
 
61
+++ b/kmail/configuredialog.cpp
 
62
@@ -863,6 +863,7 @@ AccountsPageReceivingTab::AccountsPageReceivingTab( QWidget * parent )
 
63
   connect( mVerboseNotificationCheck, SIGNAL( stateChanged( int ) ),
 
64
            this, SLOT( slotEmitChanged() ) );
 
65
 
 
66
+#ifdef INDICATEQT_FOUND
 
67
   // "Use message indicator" check box
 
68
   mUseMessageIndicatorCheck =
 
69
     new QCheckBox( i18n( "Use message indicator" ), group );
 
70
@@ -870,6 +871,9 @@ AccountsPageReceivingTab::AccountsPageReceivingTab( QWidget * parent )
 
71
     GlobalSettings::self()->useMessageIndicatorItem()->whatsThis() );
 
72
   connect( mUseMessageIndicatorCheck, SIGNAL( stateChanged( int ) ),
 
73
            this, SLOT( slotEmitChanged() ) );
 
74
+#else
 
75
+  mUseMessageIndicatorCheck = 0;
 
76
+#endif
 
77
 
 
78
   // "Other Actions" button:
 
79
   mOtherNewMailActionsButton = new QPushButton( i18n("Other Actio&ns..."), group );
 
80
@@ -879,7 +883,9 @@ AccountsPageReceivingTab::AccountsPageReceivingTab( QWidget * parent )
 
81
            this, SLOT(slotEditNotifications()) );
 
82
 
 
83
   group->layout()->addWidget( mBeepNewMailCheck );
 
84
+#ifdef INDICATEQT_FOUND
 
85
   group->layout()->addWidget( mUseMessageIndicatorCheck );
 
86
+#endif
 
87
   group->layout()->addWidget( mVerboseNotificationCheck );
 
88
   group->layout()->addWidget( mOtherNewMailActionsButton );
 
89
 }
 
90
@@ -1106,7 +1112,9 @@ void AccountsPage::ReceivingTab::slotEditNotifications()
 
91
 
 
92
 void AccountsPage::ReceivingTab::doLoadFromGlobalSettings() {
 
93
   mVerboseNotificationCheck->setChecked( GlobalSettings::self()->verboseNewMailNotification() );
 
94
+#ifdef INDICATEQT_FOUND
 
95
   mUseMessageIndicatorCheck->setChecked( GlobalSettings::self()->useMessageIndicator() );
 
96
+#endif
 
97
 }
 
98
 
 
99
 void AccountsPage::ReceivingTab::doLoadOther() {
 
100
@@ -1171,7 +1179,9 @@ void AccountsPage::ReceivingTab::save() {
 
101
   KConfigGroup general( KMKernel::config(), "General" );
 
102
   general.writeEntry( "beep-on-mail", mBeepNewMailCheck->isChecked() );
 
103
   GlobalSettings::self()->setVerboseNewMailNotification( mVerboseNotificationCheck->isChecked() );
 
104
+#ifdef INDICATEQT_FOUND
 
105
   GlobalSettings::self()->setUseMessageIndicator( mUseMessageIndicatorCheck->isChecked() );
 
106
+#endif
 
107
 
 
108
   general.writeEntry( "checkmail-startup", mCheckmailStartupCheck->isChecked() );
 
109
 
 
110
diff --git a/kmail/kmfolder.cpp b/kmail/kmfolder.cpp
 
111
index fa4afb2..a52ad62 100644
 
112
--- a/kmail/kmfolder.cpp
 
113
+++ b/kmail/kmfolder.cpp
 
114
@@ -17,6 +17,7 @@
 
115
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
116
  *
 
117
  */
 
118
+#include <config-kmail.h>
 
119
 
 
120
 #include "kmfolder.h"
 
121
 #include "kmfolderdir.h"
 
122
@@ -37,8 +38,10 @@
 
123
 #include <errno.h>
 
124
 #include <unistd.h> // W_OK
 
125
 
 
126
+#ifdef INDICATEQT_FOUND
 
127
 // libindicate
 
128
 #include <qindicateindicator.h>
 
129
+#endif
 
130
 
 
131
 #include <kdebug.h>
 
132
 #include <kde_file.h> // KDE_mkdir
 
133
@@ -943,6 +946,7 @@ void KMFolder::reallyAddCopyOfMsg( KMMessage* aMsg )
 
134
 void KMFolder::setIgnoreNewMail( bool b )
 
135
 {
 
136
   mIgnoreNewMail = b;
 
137
+#ifdef INDICATEQT_FOUND
 
138
   if ( b && mIndicator ) {
 
139
     delete mIndicator;
 
140
     mIndicator = 0;
 
141
@@ -959,6 +963,7 @@ void KMFolder::setIgnoreNewMail( bool b )
 
142
     updateIndicator();
 
143
     updateIndicatorIcon();
 
144
   }
 
145
+#endif
 
146
 }
 
147
 
 
148
 void KMFolder::setShortcut( const KShortcut &sc )
 
149
@@ -976,6 +981,7 @@ bool KMFolder::isMoveable() const
 
150
 
 
151
 void KMFolder::updateIndicator()
 
152
 {
 
153
+#ifdef INDICATEQT_FOUND
 
154
   if ( !mIndicator ) {
 
155
     return;
 
156
   }
 
157
@@ -987,10 +993,12 @@ void KMFolder::updateIndicator()
 
158
   } else {
 
159
     mIndicator->hide();
 
160
   }
 
161
+#endif
 
162
 }
 
163
 
 
164
 void KMFolder::updateIndicatorIcon()
 
165
 {
 
166
+#ifdef INDICATEQT_FOUND
 
167
   if ( !mIndicator ) {
 
168
     return;
 
169
   }
 
170
@@ -1028,6 +1036,7 @@ void KMFolder::updateIndicatorIcon()
 
171
   } else {
 
172
     mIndicator->setIconProperty( pix.toImage() );
 
173
   }
 
174
+#endif
 
175
 }
 
176
 
 
177
 void KMFolder::slotIndicatorClicked()
 
178
diff --git a/kmail/kmkernel.cpp b/kmail/kmkernel.cpp
 
179
index 9105f8d..99ae46a 100644
 
180
--- a/kmail/kmkernel.cpp
 
181
+++ b/kmail/kmkernel.cpp
 
182
@@ -84,8 +84,10 @@ using KWallet::Wallet;
 
183
 #include <stdlib.h>
 
184
 #include <assert.h>
 
185
 
 
186
+#ifdef INDICATEQT_FOUND
 
187
 // libindicate
 
188
 #include <qindicateserver.h>
 
189
+#endif
 
190
 
 
191
 #include <kcmdlineargs.h>
 
192
 #include <kstartupinfo.h>
 
193
@@ -1463,6 +1465,7 @@ void KMKernel::init()
 
194
   // moved up here because KMMessage::stripOffPrefixes is used below
 
195
   KMMessage::readConfig();
 
196
 
 
197
+#ifdef INDICATEQT_FOUND
 
198
   the_indicateServer = QIndicate::Server::defaultInstance();
 
199
   the_indicateServer->setType( "messaging" );
 
200
   QString appName = KGlobal::mainComponent().componentName();
 
201
@@ -1474,6 +1477,7 @@ void KMKernel::init()
 
202
   }
 
203
   connect( the_indicateServer, SIGNAL( serverDisplay() ),
 
204
            SLOT( toggleMainWin() ) );
 
205
+#endif
 
206
 
 
207
   the_undoStack     = new UndoStack(20);
 
208
   the_folderMgr     = new KMFolderMgr(foldersPath);
 
209
@@ -1531,11 +1535,13 @@ void KMKernel::init()
 
210
 
 
211
 void KMKernel::readConfig()
 
212
 {
 
213
+#ifdef INDICATEQT_FOUND
 
214
   if ( GlobalSettings::useMessageIndicator() ) {
 
215
     the_indicateServer->show();
 
216
   } else {
 
217
     the_indicateServer->hide();
 
218
   }
 
219
+#endif
 
220
   //Needed here, since this function is also called when the configuration
 
221
   //changes, and the static variables should be updated then - IOF
 
222
   KMMessage::readConfig();
 
223
-- 
 
224
1.6.3.3
 
225