summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-04 13:30:05 (UTC)
committer zautrix <zautrix>2005-02-04 13:30:05 (UTC)
commit76e6ad6cc6a3be8df896a3e7cf8375234b3212a9 (patch) (unidiff)
treee5dc828bed35195ae3c24bc487986efc7e0d6011
parent83256090c493dab56f1afba4829e864598bf70d2 (diff)
downloadkdepimpi-76e6ad6cc6a3be8df896a3e7cf8375234b3212a9.zip
kdepimpi-76e6ad6cc6a3be8df896a3e7cf8375234b3212a9.tar.gz
kdepimpi-76e6ad6cc6a3be8df896a3e7cf8375234b3212a9.tar.bz2
compile fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index bf41edb..2faf18f 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -154,97 +154,99 @@ void KOEventViewer::setSource(const QString& n)
154 const QByteArray paramData; 154 const QByteArray paramData;
155 QByteArray replyData; 155 QByteArray replyData;
156 QCString replyTypeStr; 156 QCString replyTypeStr;
157#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) 157#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData))
158 bool foundAbbrowser = PING_ABBROWSER; 158 bool foundAbbrowser = PING_ABBROWSER;
159 159
160 if (foundAbbrowser) { 160 if (foundAbbrowser) {
161 //KAddressbook is already running, so just DCOP to it to bring up the contact editor 161 //KAddressbook is already running, so just DCOP to it to bring up the contact editor
162 //client->send("kaddressbook","KAddressBookIface", 162 //client->send("kaddressbook","KAddressBookIface",
163 QDataStream arg(paramData, IO_WriteOnly); 163 QDataStream arg(paramData, IO_WriteOnly);
164 arg << n.mid(6); 164 arg << n.mid(6);
165 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); 165 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData);
166 return; 166 return;
167 } else { 167 } else {
168 /* 168 /*
169 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. 169 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater.
170 We start it without its main interface 170 We start it without its main interface
171 */ 171 */
172 KIconLoader* iconLoader = new KIconLoader(); 172 KIconLoader* iconLoader = new KIconLoader();
173 QString iconPath = iconLoader->iconPath("go",KIcon::Small); 173 QString iconPath = iconLoader->iconPath("go",KIcon::Small);
174 ActionManager::setStartedKAddressBook(true); 174 ActionManager::setStartedKAddressBook(true);
175 tmpStr = "kaddressbook --editor-only --uid "; 175 tmpStr = "kaddressbook --editor-only --uid ";
176 tmpStr += KProcess::quote(n.mid(6)); 176 tmpStr += KProcess::quote(n.mid(6));
177 KRun::runCommand(tmpStr,"KAddressBook",iconPath); 177 KRun::runCommand(tmpStr,"KAddressBook",iconPath);
178 return; 178 return;
179 } 179 }
180 } else { 180 } else {
181 //QTextBrowser::setSource(n); 181 //QTextBrowser::setSource(n);
182 } 182 }
183#endif 183#endif
184} 184}
185void KOEventViewer::mailToAttendees( bool all ) 185void KOEventViewer::mailToAttendees( bool all )
186{ 186{
187 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 187 QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
188 if (attendees.count() == 0) return; 188 if (attendees.count() == 0) return;
189 QStringList nameList; 189 QStringList nameList;
190 QStringList emailList; 190 QStringList emailList;
191 QStringList uidList; 191 QStringList uidList;
192 Attendee* a; 192 Attendee* a;
193 for(a=attendees.first();a;a=attendees.next()) { 193 for(a=attendees.first();a;a=attendees.next()) {
194 if ( !all && !a->RSVP() ) continue; 194 if ( !all && !a->RSVP() ) continue;
195 if (!a->email().isEmpty()) { 195 if (!a->email().isEmpty()) {
196 nameList.append (a->name() ); 196 nameList.append (a->name() );
197 emailList.append (a->email() ); 197 emailList.append (a->email() );
198 uidList.append (a->uid() ); 198 uidList.append (a->uid() );
199 } 199 }
200 } 200 }
201 QString uid = "ComposeMailUIpick2"+mMailSubject; 201 QString uid = "ComposeMailUIpick2"+mMailSubject;
202#ifndef DESKTOP_VERSION
202 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 203 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
204#endif
203 205
204} 206}
205void KOEventViewer::addTag(const QString & tag,const QString & text) 207void KOEventViewer::addTag(const QString & tag,const QString & text)
206{ 208{
207 int number=text.contains("\n"); 209 int number=text.contains("\n");
208 QString str = "<" + tag + ">"; 210 QString str = "<" + tag + ">";
209 QString tmpText=text; 211 QString tmpText=text;
210 QString tmpStr=str; 212 QString tmpStr=str;
211 if(number !=-1) 213 if(number !=-1)
212 { 214 {
213 if (number > 0) { 215 if (number > 0) {
214 int pos=0; 216 int pos=0;
215 QString tmp; 217 QString tmp;
216 for(int i=0;i<=number;i++) { 218 for(int i=0;i<=number;i++) {
217 pos=tmpText.find("\n"); 219 pos=tmpText.find("\n");
218 tmp=tmpText.left(pos); 220 tmp=tmpText.left(pos);
219 tmpText=tmpText.right(tmpText.length()-pos-1); 221 tmpText=tmpText.right(tmpText.length()-pos-1);
220 tmpStr+=tmp+"<br>"; 222 tmpStr+=tmp+"<br>";
221 } 223 }
222 } 224 }
223 else tmpStr += tmpText; 225 else tmpStr += tmpText;
224 tmpStr+="</" + tag + ">"; 226 tmpStr+="</" + tag + ">";
225 mText.append(tmpStr); 227 mText.append(tmpStr);
226 } 228 }
227 else 229 else
228 { 230 {
229 str += text + "</" + tag + ">"; 231 str += text + "</" + tag + ">";
230 mText.append(str); 232 mText.append(str);
231 } 233 }
232} 234}
233 235
234void KOEventViewer::setColorMode( int m ) 236void KOEventViewer::setColorMode( int m )
235{ 237{
236 mColorMode = m; 238 mColorMode = m;
237} 239}
238void KOEventViewer::appendEvent(Event *event, int mode ) 240void KOEventViewer::appendEvent(Event *event, int mode )
239{ 241{
240 mMailSubject = ""; 242 mMailSubject = "";
241 mCurrentIncidence = event; 243 mCurrentIncidence = event;
242 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 244 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
243 topLevelWidget()->setCaption(i18n("Event Viewer")); 245 topLevelWidget()->setCaption(i18n("Event Viewer"));
244 if ( mode == 0 ) { 246 if ( mode == 0 ) {
245 addTag("h2",event->summary()); 247 addTag("h2",event->summary());
246 } 248 }
247 else { 249 else {
248 if ( mColorMode == 1 ) { 250 if ( mColorMode == 1 ) {
249 mText +="<font color=\"#00A000\">"; 251 mText +="<font color=\"#00A000\">";
250 } 252 }