diff options
Diffstat (limited to 'kalarm/functions.cpp')
-rw-r--r-- | kalarm/functions.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/kalarm/functions.cpp b/kalarm/functions.cpp index db0ff7d34..97d046896 100644 --- a/kalarm/functions.cpp +++ b/kalarm/functions.cpp @@ -129,10 +129,10 @@ TemplateMenuAction* createNewFromTemplateAction(const TQString& label, TQObject* * event in that listView instance. * 'event' is updated with the actual event ID. */ -UpdateStatus addEvent(KAEvent& event, AlarmListView* selectionView, TQWidget* errmsgParent, bool useEventID, bool allowKOrgUpdate) +UpdatetqStatus addEvent(KAEvent& event, AlarmListView* selectionView, TQWidget* errmsgParent, bool useEventID, bool allowKOrgUpdate) { kdDebug(5950) << "KAlarm::addEvent(): " << event.id() << endl; - UpdateStatus status = UPDATE_OK; + UpdatetqStatus status = UPDATE_OK; if (!theApp()->checkCalendarDaemon()) // ensure calendar is open and daemon started return UPDATE_FAILED; else @@ -172,7 +172,7 @@ bool addExpiredEvent(KAEvent& event) AlarmCalendar* cal = AlarmCalendar::expiredCalendarOpen(); if (!cal) return false; - bool archiving = (KAEvent::uidStatus(event.id()) == KAEvent::ACTIVE); + bool archiving = (KAEvent::uidtqStatus(event.id()) == KAEvent::ACTIVE); if (archiving) event.setSaveDateTime(TQDateTime::tqcurrentDateTime()); // time stamp to control purging KCal::Event* kcalEvent = cal->addEvent(event); @@ -193,10 +193,10 @@ bool addExpiredEvent(KAEvent& event) * event in that listView instance. * 'event' is updated with the actual event ID. */ -UpdateStatus addTemplate(KAEvent& event, TemplateListView* selectionView, TQWidget* errmsgParent) +UpdatetqStatus addTemplate(KAEvent& event, TemplateListView* selectionView, TQWidget* errmsgParent) { kdDebug(5950) << "KAlarm::addTemplate(): " << event.id() << endl; - UpdateStatus status = UPDATE_OK; + UpdatetqStatus status = UPDATE_OK; // Add the template to the calendar file AlarmCalendar* cal = AlarmCalendar::templateCalendarOpen(); @@ -206,7 +206,7 @@ UpdateStatus addTemplate(KAEvent& event, TemplateListView* selectionView, TQWidg status = SAVE_FAILED; else { - cal->emitEmptyStatus(); + cal->emitEmptytqStatus(); // Update the window lists TemplateListView::addEvent(event, selectionView); @@ -225,11 +225,11 @@ UpdateStatus addTemplate(KAEvent& event, TemplateListView* selectionView, TQWidg * If 'selectionView' is non-null, the selection highlight is moved to the * modified event in that listView instance. */ -UpdateStatus modifyEvent(KAEvent& oldEvent, const KAEvent& newEvent, AlarmListView* selectionView, TQWidget* errmsgParent) +UpdatetqStatus modifyEvent(KAEvent& oldEvent, const KAEvent& newEvent, AlarmListView* selectionView, TQWidget* errmsgParent) { kdDebug(5950) << "KAlarm::modifyEvent(): '" << oldEvent.id() << endl; - UpdateStatus status = UPDATE_OK; + UpdatetqStatus status = UPDATE_OK; if (!newEvent.valid()) { deleteEvent(oldEvent, true); @@ -280,7 +280,7 @@ UpdateStatus modifyEvent(KAEvent& oldEvent, const KAEvent& newEvent, AlarmListVi * The event is not updated in KOrganizer, since this function is called when an * existing alarm is rescheduled (due to recurrence or deferral). */ -UpdateStatus updateEvent(KAEvent& event, AlarmListView* selectionView, TQWidget* errmsgParent, bool archiveOnDelete, bool incRevision) +UpdatetqStatus updateEvent(KAEvent& event, AlarmListView* selectionView, TQWidget* errmsgParent, bool archiveOnDelete, bool incRevision) { kdDebug(5950) << "KAlarm::updateEvent(): " << event.id() << endl; @@ -311,9 +311,9 @@ UpdateStatus updateEvent(KAEvent& event, AlarmListView* selectionView, TQWidget* * If 'selectionView' is non-null, the selection highlight is moved to the * updated event in that listView instance. */ -UpdateStatus updateTemplate(const KAEvent& event, TemplateListView* selectionView, TQWidget* errmsgParent) +UpdatetqStatus updateTemplate(const KAEvent& event, TemplateListView* selectionView, TQWidget* errmsgParent) { - UpdateStatus status = UPDATE_OK; + UpdatetqStatus status = UPDATE_OK; AlarmCalendar* cal = AlarmCalendar::templateCalendarOpen(); if (!cal) status = UPDATE_FAILED; @@ -338,7 +338,7 @@ UpdateStatus updateTemplate(const KAEvent& event, TemplateListView* selectionVie * Delete an alarm from the calendar file and from every main window instance. * If the event is archived, the event's ID is changed to an expired ID if necessary. */ -UpdateStatus deleteEvent(KAEvent& event, bool archive, TQWidget* errmsgParent) +UpdatetqStatus deleteEvent(KAEvent& event, bool archive, TQWidget* errmsgParent) { TQString id = event.id(); kdDebug(5950) << "KAlarm::deleteEvent(): " << id << endl; @@ -346,11 +346,11 @@ UpdateStatus deleteEvent(KAEvent& event, bool archive, TQWidget* errmsgParent) // Update the window lists AlarmListView::deleteEvent(id); - UpdateStatus status = UPDATE_OK; + UpdatetqStatus status = UPDATE_OK; AlarmCalendar* cal; // Delete the event from the calendar file - if (KAEvent::uidStatus(id) == KAEvent::EXPIRED) + if (KAEvent::uidtqStatus(id) == KAEvent::EXPIRED) { cal = AlarmCalendar::expiredCalendarOpen(); if (!cal) @@ -383,7 +383,7 @@ UpdateStatus deleteEvent(KAEvent& event, bool archive, TQWidget* errmsgParent) /****************************************************************************** * Delete a template from the calendar file and from every template list view. */ -UpdateStatus deleteTemplate(const KAEvent& event) +UpdatetqStatus deleteTemplate(const KAEvent& event) { TQString id = event.id(); @@ -393,7 +393,7 @@ UpdateStatus deleteTemplate(const KAEvent& event) return UPDATE_FAILED; if (!cal->deleteEvent(id, true)) // save calendar after deleting return SAVE_FAILED; - cal->emitEmptyStatus(); + cal->emitEmptytqStatus(); // Update the window lists TemplateListView::deleteEvent(id); @@ -407,7 +407,7 @@ void deleteDisplayEvent(const TQString& eventID) { kdDebug(5950) << "KAlarm::deleteDisplayEvent(" << eventID << ")\n"; - if (KAEvent::uidStatus(eventID) == KAEvent::DISPLAYING) + if (KAEvent::uidtqStatus(eventID) == KAEvent::DISPLAYING) { AlarmCalendar* cal = AlarmCalendar::displayCalendarOpen(); if (cal) @@ -421,13 +421,13 @@ void deleteDisplayEvent(const TQString& eventID) * If 'selectionView' is non-null, the selection highlight is moved to the * restored event in that listView instance. */ -UpdateStatus reactivateEvent(KAEvent& event, AlarmListView* selectionView, bool useEventID) +UpdatetqStatus reactivateEvent(KAEvent& event, AlarmListView* selectionView, bool useEventID) { TQString id = event.id(); kdDebug(5950) << "KAlarm::reactivateEvent(): " << id << endl; // Delete the event from the expired calendar file - if (KAEvent::uidStatus(id) == KAEvent::EXPIRED) + if (KAEvent::uidtqStatus(id) == KAEvent::EXPIRED) { TQDateTime now = TQDateTime::tqcurrentDateTime(); if (event.occursAfter(now, true)) @@ -443,7 +443,7 @@ UpdateStatus reactivateEvent(KAEvent& event, AlarmListView* selectionView, bool if (!cal->save()) return SAVE_FAILED; - UpdateStatus status = UPDATE_OK; + UpdatetqStatus status = UPDATE_OK; if (event.copyToKOrganizer()) { if (!sendToKOrganizer(event)) // tell KOrganizer to show the event @@ -468,7 +468,7 @@ UpdateStatus reactivateEvent(KAEvent& event, AlarmListView* selectionView, bool * If 'selectionView' is non-null, the selection highlight is moved to the * updated event in that listView instance. */ -UpdateStatus enableEvent(KAEvent& event, AlarmListView* selectionView, bool enable) +UpdatetqStatus enableEvent(KAEvent& event, AlarmListView* selectionView, bool enable) { kdDebug(5950) << "KAlarm::enableEvent(" << enable << "): " << event.id() << endl; @@ -498,7 +498,7 @@ UpdateStatus enableEvent(KAEvent& event, AlarmListView* selectionView, bool enab /****************************************************************************** * Display an error message about an error saving an event. */ -void displayUpdateError(TQWidget* parent, UpdateStatus, UpdateError code, int nAlarms) +void displayUpdateError(TQWidget* tqparent, UpdatetqStatus, UpdateError code, int nAlarms) { TQString errmsg; switch (code) @@ -519,13 +519,13 @@ void displayUpdateError(TQWidget* parent, UpdateStatus, UpdateError code, int nA errmsg = i18n("Error saving alarm template"); break; } - KMessageBox::error(parent, errmsg); + KMessageBox::error(tqparent, errmsg); } /****************************************************************************** * Display an error message corresponding to a specified alarm update error code. */ -void displayKOrgUpdateError(TQWidget* parent, KOrgUpdateError code, int nAlarms) +void displayKOrgUpdateError(TQWidget* tqparent, KOrgUpdateError code, int nAlarms) { TQString errmsg; switch (code) @@ -542,7 +542,7 @@ void displayKOrgUpdateError(TQWidget* parent, KOrgUpdateError code, int nAlarms) : i18n("Unable to delete alarm from KOrganizer"); break; } - KMessageBox::error(parent, errmsg); + KMessageBox::error(tqparent, errmsg); } /****************************************************************************** @@ -551,7 +551,7 @@ void displayKOrgUpdateError(TQWidget* parent, KOrgUpdateError code, int nAlarms) bool edit(const TQString& eventID) { AlarmCalendar* cal; - switch (KAEvent::uidStatus(eventID)) + switch (KAEvent::uidtqStatus(eventID)) { case KAEvent::ACTIVE: cal = AlarmCalendar::activeCalendar(); @@ -628,17 +628,17 @@ TQValueList<KAEvent> templateList() * Prompt the user to re-enable alarms if they are currently disabled, and if * it's an email alarm, warn if no 'From' email address is configured. */ -void outputAlarmWarnings(TQWidget* parent, const KAEvent* event) +void outputAlarmWarnings(TQWidget* tqparent, const KAEvent* event) { if (event && event->action() == KAEvent::EMAIL && Preferences::emailAddress().isEmpty()) - KMessageBox::information(parent, i18n("Please set the 'From' email address...", + KMessageBox::information(tqparent, i18n("Please set the 'From' email address...", "%1\nPlease set it in the Preferences dialog.").arg(KAMail::i18n_NeedFromEmailAddress())); if (!Daemon::monitoringAlarms()) { - if (KMessageBox::warningYesNo(parent, i18n("Alarms are currently disabled.\nDo you want to enable alarms now?"), - TQString::null, i18n("Enable"), i18n("Keep Disabled"), + if (KMessageBox::warningYesNo(tqparent, i18n("Alarms are currently disabled.\nDo you want to enable alarms now?"), + TQString(), i18n("Enable"), i18n("Keep Disabled"), TQString::tqfromLatin1("EditEnableAlarms")) == KMessageBox::Yes) Daemon::setAlarmsEnabled(); @@ -706,14 +706,14 @@ TQString runKMail(bool minimise) TQString errmsg; if (!runProgram("kmail", (minimise ? KMAIL_DCOP_WINDOW : ""), dcopName, errmsg)) return i18n("Unable to start KMail\n(%1)").arg(errmsg); - return TQString::null; + return TQString(); } /****************************************************************************** * Start another program for DCOP access if it isn't already running. * If 'windowName' is not empty, the program's window of that name is iconised. -* On exit, 'dcopName' tqcontains the DCOP name to access the application, and -* 'errorMessage' tqcontains an error message if failure. +* On exit, 'dcopName' contains the DCOP name to access the application, and +* 'errorMessage' contains an error message if failure. * Reply = true if the program is now running. */ bool runProgram(const TQCString& program, const TQCString& windowName, TQCString& dcopName, TQString& errorMessage) @@ -721,7 +721,7 @@ bool runProgram(const TQCString& program, const TQCString& windowName, TQCString if (!kapp->dcopClient()->isApplicationRegistered(program)) { // KOrganizer is not already running, so start it - if (KApplication::startServiceByDesktopName(TQString::tqfromLatin1(program), TQString::null, &errorMessage, &dcopName)) + if (KApplication::startServiceByDesktopName(TQString::tqfromLatin1(program), TQString(), &errorMessage, &dcopName)) { kdError(5950) << "runProgram(): couldn't start " << program << " (" << errorMessage << ")\n"; return false; @@ -729,11 +729,11 @@ bool runProgram(const TQCString& program, const TQCString& windowName, TQCString // Minimise its window - don't use hide() since this would remove all // trace of it from the panel if it is not configured to be docked in // the system tray. - kapp->dcopClient()->send(dcopName, windowName, "minimize()", TQString::null); + kapp->dcopClient()->send(dcopName, windowName, "minimize()", TQString()); } else if (dcopName.isEmpty()) dcopName = program; - errorMessage = TQString::null; + errorMessage = TQString(); return true; } @@ -792,7 +792,7 @@ int getVersionNumber(const TQString& version, TQString* subVersion) // N.B. Remember to change Version(int major, int minor, int rev) // if the representation returned by this method changes. if (subVersion) - *subVersion = TQString::null; + *subVersion = TQString(); int count = version.tqcontains('.') + 1; if (count < 2) return 0; @@ -836,7 +836,7 @@ FileType fileType(const TQString& mimetype) if (mimetype.startsWith(TQString::tqfromLatin1("image/"))) return Image; - int slash = mimetype.find('/'); + int slash = mimetype.tqfind('/'); if (slash < 0) return Unknown; TQString type = mimetype.mid(slash + 1); @@ -868,19 +868,19 @@ FileType fileType(const TQString& mimetype) * Reply = URL selected. If none is selected, URL.isEmpty() is true. */ TQString browseFile(const TQString& caption, TQString& defaultDir, const TQString& initialFile, - const TQString& filter, int mode, TQWidget* parent, const char* name) + const TQString& filter, int mode, TQWidget* tqparent, const char* name) { TQString initialDir = !initialFile.isEmpty() ? TQString(initialFile).remove(TQRegExp("/[^/]*$")) : !defaultDir.isEmpty() ? defaultDir : TQDir::homeDirPath(); - KFileDialog fileDlg(initialDir, filter, parent, name, true); + KFileDialog fileDlg(initialDir, filter, tqparent, name, true); fileDlg.setOperationMode(mode & KFile::ExistingOnly ? KFileDialog::Opening : KFileDialog::Saving); fileDlg.setMode(KFile::File | mode); fileDlg.setCaption(caption); if (!initialFile.isEmpty()) fileDlg.setSelection(initialFile); if (fileDlg.exec() != TQDialog::Accepted) - return TQString::null; + return TQString(); KURL url = fileDlg.selectedURL(); defaultDir = url.path(); return (mode & KFile::LocalOnly) ? url.path() : url.prettyURL(); @@ -959,17 +959,17 @@ bool sendToKOrganizer(const KAEvent& event) ? KAMail::identityManager()->identityForUoid(event.emailFromId()).fullEmailAddr() : Preferences::emailAddress(); AlarmText atext; - atext.setEmail(event.emailAddresses(", "), from, TQString::null, TQString::null, event.emailSubject(), TQString::null); + atext.setEmail(event.emailAddresses(", "), from, TQString(), TQString(), event.emailSubject(), TQString()); kcalEvent->setSummary(atext.displayText()); userEmail = from; break; } } - kcalEvent->setOrganizer(KCal::Person(TQString::null, userEmail)); + kcalEvent->setOrganizer(KCal::Person(TQString(), userEmail)); // Translate the event into string format KCal::ICalFormat format; - format.setTimeZone(TQString::null, false); + format.setTimeZone(TQString(), false); TQString iCal = format.toICalString(kcalEvent); kdDebug(5950)<<"Korg->"<<iCal<<endl; delete kcalEvent; @@ -1032,7 +1032,7 @@ bool runKOrganizer() { TQString error; TQCString dcopService; - int result = KDCOPServiceStarter::self()->tqfindServiceFor("DCOP/Organizer", TQString::null, TQString::null, &error, &dcopService); + int result = KDCOPServiceStarter::self()->findServiceFor("DCOP/Organizer", TQString(), TQString(), &error, &dcopService); if (result) { kdDebug(5950) << "Unable to start DCOP/Organizer: " << dcopService << " " << error << endl; @@ -1042,7 +1042,7 @@ bool runKOrganizer() // to load KOrganizer into Kontact. But if KOrganizer is running independently, // the load() method doesn't exist. TQCString dummy; - if (!kapp->dcopClient()->tqfindObject(dcopService, KORG_DCOP_OBJECT, "", TQByteArray(), dummy, dummy)) + if (!kapp->dcopClient()->findObject(dcopService, KORG_DCOP_OBJECT, "", TQByteArray(), dummy, dummy)) { DCOPRef ref(dcopService, dcopService); // talk to the KUniqueApplication or its Kontact wrapper DCOPReply reply = ref.call("load()"); @@ -1051,7 +1051,7 @@ bool runKOrganizer() kdWarning(5950) << "Error loading " << dcopService << endl; return false; } - if (!kapp->dcopClient()->tqfindObject(dcopService, KORG_DCOP_OBJECT, "", TQByteArray(), dummy, dummy)) + if (!kapp->dcopClient()->findObject(dcopService, KORG_DCOP_OBJECT, "", TQByteArray(), dummy, dummy)) { kdWarning(5950) << "Unable to access KOrganizer's "KORG_DCOP_OBJECT" DCOP object" << endl; return false; |