Git commit fe52177e25a95507ea6a44c1eb0f481c4934ad30 by David Jarvie. Committed on 30/04/2014 at 23:47. Pushed by djarvie into branch 'frameworks'. Remove non-Akonadi files M +25 -79 kalarm/CMakeLists.txt D +0 -64 kalarm/alarmlistfiltermodel.cpp D +0 -52 kalarm/alarmlistfiltermodel.h D +0 -74 kalarm/calendarcompat.cpp D +0 -41 kalarm/calendarcompat.h D +0 -969 kalarm/eventlistmodel.cpp D +0 -147 kalarm/eventlistmodel.h D +0 -143 kalarm/resourceconfigdialog.cpp D +0 -60 kalarm/resourceconfigdialog.h D +0 -542 kalarm/resourcemodelview.cpp D +0 -116 kalarm/resourcemodelview.h D +0 -79 kalarm/resources/CMakeLists.txt D +0 -444 kalarm/resources/alarmresource.cpp D +0 -261 kalarm/resources/alarmresource.h D +0 -828 kalarm/resources/alarmresources.cpp D +0 -475 kalarm/resources/alarmresources.h D +0 -60 kalarm/resources/kalarm_manager.desktop D +0 -43 kalarm/resources/kalarm_resources_export.h D +0 -104 kalarm/resources/local.desktop D +0 -104 kalarm/resources/localdir.desktop D +0 -104 kalarm/resources/remote.desktop D +0 -272 kalarm/resources/resourcelocal.cpp D +0 -90 kalarm/resources/resourcelocal.h D +0 -40 kalarm/resources/resourcelocal_plugin.cpp D +0 -494 kalarm/resources/resourcelocaldir.cpp D +0 -104 kalarm/resources/resourcelocaldir.h D +0 -40 kalarm/resources/resourcelocaldir_plugin.cpp D +0 -78 kalarm/resources/resourcelocaldirwidget.cpp D +0 -51 kalarm/resources/resourcelocaldirwidget.h D +0 -83 kalarm/resources/resourcelocalwidget.cpp D +0 -51 kalarm/resources/resourcelocalwidget.h D +0 -368 kalarm/resources/resourceremote.cpp D +0 -111 kalarm/resources/resourceremote.h D +0 -41 kalarm/resources/resourceremote_plugin.cpp D +0 -101 kalarm/resources/resourceremotewidget.cpp D +0 -59 kalarm/resources/resourceremotewidget.h D +0 -58 kalarm/resources/resourcewidget.cpp D +0 -49 kalarm/resources/resourcewidget.h D +0 -120 kalarm/templatelistfiltermodel.cpp D +0 -59 kalarm/templatelistfiltermodel.h http://commits.kde.org/kdepim/fe52177e25a95507ea6a44c1eb0f481c4934ad30 diff --git a/kalarm/CMakeLists.txt b/kalarm/CMakeLists.txt index 9967a56..a7d193f 100644 --- a/kalarm/CMakeLists.txt +++ b/kalarm/CMakeLists.txt @@ -8,9 +8,6 @@ add_definitions( -DQT_NO_CAST_TO_ASCII ) = set(CMAKE_AUTOMOC_RELAXED_MODE ON) = -option(KALARM_USE_AKONADI "Build to use Akonadi" ON) - - add_definitions(-DUSE_AKONADI) if (NOT CMAKE_VERSION VERSION_LESS 2.8.12 AND (CMAKE_VERSION VERSION_L= ESS 2.8.12.1 OR CMAKE_VERSION VERSION_LESS 2.8.13 # Temporary measure becau= se build.kde.org uses a datestamped CMake version @@ -21,7 +18,6 @@ option(KALARM_USE_AKONADI "Build to use Akonadi" ON) kde_enable_exceptions() = = -if(KALARM_USE_AKONADI) include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/ @@ -30,21 +26,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/libkdepim/ ${Boost_INCLUDE_DIR} ) -else() -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/ - ${CMAKE_CURRENT_SOURCE_DIR}/lib - ${CMAKE_CURRENT_SOURCE_DIR}/resources - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/libkdepim/ - ${Boost_INCLUDE_DIR} -) -endif() = -if(NOT KALARM_USE_AKONADI) - add_subdirectory(resources) -endif() add_subdirectory(appicons) add_subdirectory(pixmaps) add_subdirectory(autostart) @@ -126,7 +108,6 @@ set(kalarm_bin_SRCS ${libkalarm_SRCS} templatemenuaction.cpp wakedlg.cpp ) -if(KALARM_USE_AKONADI) set(kalarm_bin_SRCS ${kalarm_bin_SRCS} akonadimodel.cpp akonadiresourcecreator.cpp @@ -136,16 +117,6 @@ set(kalarm_bin_SRCS ${kalarm_bin_SRCS} calendarmigrator.cpp eventid.cpp ) -else() -set(kalarm_bin_SRCS ${kalarm_bin_SRCS} - calendarcompat.cpp - eventlistmodel.cpp - alarmlistfiltermodel.cpp - resourceconfigdialog.cpp - resourcemodelview.cpp - templatelistfiltermodel.cpp - ) -endif() = qt5_wrap_ui(kalarm_bin_SRCS wakedlg.ui @@ -157,70 +128,45 @@ if (KMAIL_SUPPORTED) endif () #REACTIVATE qt4_add_dbus_interfaces(kalarm_bin_SRCS ${KDE4_DBUS_INTERFACES= _DIR}/org.kde.KSpeech.xml) = -if(KALARM_USE_AKONADI) - kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kalarmresourc= e.kcfg org.kde.Akonadi.KAlarm.Settings) - qt4_add_dbus_interface(kalarm_bin_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org= .kde.Akonadi.KAlarm.Settings.xml kalarmsettings KAlarmSettings) +kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kalarmresource.kc= fg org.kde.Akonadi.KAlarm.Settings) +qt4_add_dbus_interface(kalarm_bin_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde= .Akonadi.KAlarm.Settings.xml kalarmsettings KAlarmSettings) = - kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kalarmdirreso= urce.kcfg org.kde.Akonadi.KAlarmDir.Settings) - qt4_add_dbus_interface(kalarm_bin_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org= .kde.Akonadi.KAlarmDir.Settings.xml kalarmdirsettings KAlarmDirSettings) +kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kalarmdirresource= .kcfg org.kde.Akonadi.KAlarmDir.Settings) +qt4_add_dbus_interface(kalarm_bin_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde= .Akonadi.KAlarmDir.Settings.xml kalarmdirsettings KAlarmDirSettings) = - qt4_add_dbus_interfaces(kalarm_bin_SRCS ${AKONADI_DBUS_INTERFACES_DIR}= /org.freedesktop.Akonadi.Agent.Control.xml) -# qt5_add_dbus_adaptor(kalarm_bin_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/o= rg.freedesktop.Akonadi.Agent.Control.xml agentbase.h Akonadi::AgentBase con= troladaptor Akonadi__ControlAdaptor) -endif() +qt4_add_dbus_interfaces(kalarm_bin_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org= .freedesktop.Akonadi.Agent.Control.xml) +#qt5_add_dbus_adaptor(kalarm_bin_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.f= reedesktop.Akonadi.Agent.Control.xml agentbase.h Akonadi::AgentBase control= adaptor Akonadi__ControlAdaptor) = kconfig_add_kcfg_files(kalarm_bin_SRCS GENERATE_MOC kalarmconfig.kcfgc) = #if (UNIX) kde4_add_app_icon(kalarm_bin_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/appicons/ox= *-app-kalarm.png") add_executable(kalarm_bin ${kalarm_bin_SRCS}) -if(KALARM_USE_AKONADI) - add_dependencies(kalarm_bin kalarm_resource_xml kalarmdir_resource_xml) -endif() +add_dependencies(kalarm_bin kalarm_resource_xml kalarmdir_resource_xml) if (KMAIL_SUPPORTED) add_dependencies(kalarm_bin kmail_xml) endif () = set_target_properties(kalarm_bin PROPERTIES OUTPUT_NAME kalarm) = -if(KALARM_USE_AKONADI) - target_link_libraries(kalarm_bin - KF5::AlarmCalendar - KF5::CalendarCore - KF5::CalendarUtils - KF5::Abc - KF5::Mime - KF5::PimIdentities - KF5::MailTransport - KF5::AkonadiCore - KF5::AkonadiMime - KF5::AkonadiContact - KF5::Holidays - KF5::PimUtils - kdepim - KF5::KCMUtils - ${KDE4_PHONON_LIBS} - ${X11_X11_LIB} - ) -else() - target_link_libraries(kalarm_bin - kalarm_resources - KF5::AlarmCalendar - ${KDEPIMLIBS_KCAL_LIBS} - KF5::Abc - KF5::Mime - KF5::PimIdentities - KF5::MailTransport - KF5::AkonadiCore - KF5::AkonadiMime - KF5::AkonadiContact - KF5::Holidays - KF5::PimUtils - kdepim - KF5::KCMUtils - ${KDE4_PHONON_LIBS} - ${X11_X11_LIB} - ) -endif() +target_link_libraries(kalarm_bin +KF5::AlarmCalendar +KF5::CalendarCore +KF5::CalendarUtils +KF5::Abc +KF5::Mime +KF5::PimIdentities +KF5::MailTransport +KF5::AkonadiCore +KF5::AkonadiMime +KF5::AkonadiContact +KF5::Holidays +KF5::PimUtils +kdepim +KF5::KCMUtils +${KDE4_PHONON_LIBS} +${X11_X11_LIB} +) = = install(TARGETS kalarm_bin ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/kalarm/alarmlistfiltermodel.cpp b/kalarm/alarmlistfiltermodel.= cpp deleted file mode 100644 index 6c346d5..0000000 --- a/kalarm/alarmlistfiltermodel.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * alarmlistfiltermodel.cpp - proxy model class for lists of alarms - * Program: kalarm - * Copyright =C2=A9 2007-2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" //krazy:exclude=3Dincludes (kalarm.h must be first) -#include "alarmlistfiltermodel.h" - -#include "eventlistmodel.h" - -#include - -using namespace KAlarmCal; - -// AlarmListFilterModel provides sorting and filtering for the alarm list = model. - - -AlarmListFilterModel::AlarmListFilterModel(EventListModel* baseModel, QObj= ect* parent) - : EventListFilterModel(baseModel, parent), - mStatusFilter(CalEvent::EMPTY) -{} - -void AlarmListFilterModel::setStatusFilter(CalEvent::Types type) -{ - if (type !=3D mStatusFilter) - { - mStatusFilter =3D type; - invalidateFilter(); - } -} - -bool AlarmListFilterModel::filterAcceptsRow(int sourceRow, const QModelInd= ex&) const -{ - return sourceModel()->data(sourceModel()->index(sourceRow, 0), EventLi= stModel::StatusRole).toInt() & mStatusFilter; -} - -bool AlarmListFilterModel::filterAcceptsColumn(int sourceCol, const QModel= Index&) const -{ - return (sourceCol !=3D EventListModel::TemplateNameColumn); -} - -QModelIndex AlarmListFilterModel::mapFromSource(const QModelIndex& sourceI= ndex) const -{ - if (sourceIndex.column() =3D=3D EventListModel::TemplateNameColumn) - return QModelIndex(); - return EventListFilterModel::mapFromSource(sourceIndex); -} - -// vim: et sw=3D4: diff --git a/kalarm/alarmlistfiltermodel.h b/kalarm/alarmlistfiltermodel.h deleted file mode 100644 index d85feef..0000000 --- a/kalarm/alarmlistfiltermodel.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * alarmlistfiltermodel.h - proxy model class for lists of alarms - * Program: kalarm - * Copyright =C2=A9 2007-2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef ALARMLISTFILTERMODEL_H -#define ALARMLISTFILTERMODEL_H - -#include "kalarm.h" - -#include "eventlistmodel.h" - -#include - - -class AlarmListFilterModel : public EventListFilterModel -{ - Q_OBJECT - public: - enum { ColumnCount =3D 6 }; - - explicit AlarmListFilterModel(EventListModel* baseModel, QObject* = parent =3D 0); - void setStatusFilter(CalEvent::Types); - CalEvent::Types statusFilter() const { return mStatusFilter= ; } - virtual QModelIndex mapFromSource(const QModelIndex& sourceIndex)= const; - - protected: - virtual bool filterAcceptsRow(int sourceRow, const QModelIndex& so= urceParent) const; - virtual bool filterAcceptsColumn(int sourceCol, const QModelIndex&= sourceParent) const; - - private: - CalEvent::Types mStatusFilter; -}; - -#endif // ALARMLISTFILTERMODEL_H - -// vim: et sw=3D4: diff --git a/kalarm/calendarcompat.cpp b/kalarm/calendarcompat.cpp deleted file mode 100644 index 89215ef..0000000 --- a/kalarm/calendarcompat.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * calendarcompat.cpp - compatibility for old calendar file formats - * Program: kalarm - * Copyright =C2=A9 2001-2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "calendarcompat.h" -#include "functions.h" -#include "mainwindow.h" -#include "messagebox.h" - -#include - -#include - -namespace CalendarCompat -{ - -/*************************************************************************= ***** -* Find the version of KAlarm which wrote the calendar file, and do any -* necessary conversions to the current format. If it is a resource calenda= r, -* the user is prompted whether to save the conversions. For a local calend= ar -* file, any conversions will only be saved if changes are made later. -* If the calendar only contains the wrong alarm types, 'wrongType' is set = true. -* Reply =3D true if the calendar file is now in the current format. -*/ -KACalendar::Compat fix(KCal::CalendarLocal& calendar, const QString& local= File, AlarmResource* resource, - AlarmResource::FixFunc conv, bool* wrongType) -{ - if (wrongType) - *wrongType =3D false; - QString versionString; - int version =3D KACalendar::updateVersion(calendar, localFile, version= String); - if (version =3D=3D KACalendar::IncompatibleFormat) - return KACalendar::Incompatible; // calendar was created by ano= ther program, or an unknown version of KAlarm - if (!resource) - return KACalendar::Current; // update non-shared calendars rega= rdless - - // Check whether the alarm types in the calendar correspond with the r= esource's alarm type - if (wrongType) - *wrongType =3D !resource->checkAlarmTypes(calendar); - - if (version =3D=3D KACalendar::CurrentFormat) - return KACalendar::Current; // calendar is in current KAlarm f= ormat - if (resource->ResourceCached::readOnly() || conv =3D=3D AlarmResourc= e::NO_CONVERT) - return KACalendar::Convertible; - // Update the calendar file now if the user wants it to be read-write - if (conv =3D=3D AlarmResource::PROMPT || conv =3D=3D AlarmResource::= PROMPT_PART) - { - QString msg =3D KAlarm::conversionPrompt(resource->resourceName(),= versionString, (conv =3D=3D AlarmResource::PROMPT)); - if (KAMessageBox::warningYesNo(MainWindow::mainMainWindow(), msg) = !=3D KMessageBox::Yes) - return KACalendar::Convertible; - } - KACalendar::setKAlarmVersion(calendar); - return KACalendar::Converted; -} - -} // namespace CalendarCompat - -// vim: et sw=3D4: diff --git a/kalarm/calendarcompat.h b/kalarm/calendarcompat.h deleted file mode 100644 index cc7b240..0000000 --- a/kalarm/calendarcompat.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * calendarcompat.h - compatibility for old calendar file formats - * Program: kalarm - * Copyright =C2=A9 2005-2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef CALENDARCOMPAT_H -#define CALENDARCOMPAT_H - -#ifndef USE_AKONADI - -#include "alarmresource.h" -#include -namespace KCal { class CalendarLocal; } - - -namespace CalendarCompat -{ - KACalendar::Compat fix(KCal::CalendarLocal&, const QString& localFile, - AlarmResource* =3D 0, AlarmResource::FixFunc = =3D AlarmResource::PROMPT, bool* wrongType =3D 0); -} - -#endif - -#endif // CALENDARCOMPAT_H - -// vim: et sw=3D4: diff --git a/kalarm/eventlistmodel.cpp b/kalarm/eventlistmodel.cpp deleted file mode 100644 index e99a8bf..0000000 --- a/kalarm/eventlistmodel.cpp +++ /dev/null @@ -1,969 +0,0 @@ -/* - * eventlistmodel.cpp - model class for lists of alarms or templates - * Program: kalarm - * Copyright =C2=A9 2007-2012 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resources/alarmresource.h" -#include "resources/alarmresources.h" -#include "alarmcalendar.h" -#include "alarmtime.h" -#include "preferences.h" -#include "synchtimer.h" -#include "eventlistmodel.moc" - -#include - -#include -#include -#include - -#include - -/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D -=3D Class: EventListModel -=3D Contains all active/archived alarms, or all alarm templates, unsorted. -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D*/ - -EventListModel* EventListModel::mAlarmInstance =3D 0; -EventListModel* EventListModel::mTemplateInstance =3D 0; -QPixmap* EventListModel::mTextIcon =3D 0; -QPixmap* EventListModel::mFileIcon =3D 0; -QPixmap* EventListModel::mCommandIcon =3D 0; -QPixmap* EventListModel::mEmailIcon =3D 0; -QPixmap* EventListModel::mAudioIcon =3D 0; -QSize EventListModel::mIconSize; -int EventListModel::mTimeHourPos =3D -2; - - -EventListModel* EventListModel::alarms() -{ - if (!mAlarmInstance) - { - mAlarmInstance =3D new EventListModel(CalEvent::ACTIVE | CalEvent:= :ARCHIVED); - Preferences::connect(SIGNAL(archivedColourChanged(QColor)), mAlarm= Instance, SLOT(slotUpdateArchivedColour(QColor))); - Preferences::connect(SIGNAL(disabledColourChanged(QColor)), mAlarm= Instance, SLOT(slotUpdateDisabledColour(QColor))); - Preferences::connect(SIGNAL(holidaysChanged(KHolidays::HolidayRegi= on)), mAlarmInstance, SLOT(slotUpdateHolidays())); - Preferences::connect(SIGNAL(workTimeChanged(QTime,QTime,QBitArray)= ), mAlarmInstance, SLOT(slotUpdateWorkingHours())); - } - return mAlarmInstance; -} - -EventListModel* EventListModel::templates() -{ - if (!mTemplateInstance) - mTemplateInstance =3D new EventListModel(CalEvent::TEMPLATE); - return mTemplateInstance; -} - -EventListModel::~EventListModel() -{ - if (this =3D=3D mAlarmInstance) - mAlarmInstance =3D 0; - else if (this =3D=3D mTemplateInstance) - mTemplateInstance =3D 0; -} - -EventListModel::EventListModel(CalEvent::Types status, QObject* parent) - : QAbstractTableModel(parent), - mStatus(status) -{ - // Load the current list of alarms. - // The list will be updated whenever a signal is received notifying ch= anges. - // We need to store the list so that when deletions occur, the deleted= alarm's - // position in the list can be determined. - mEvents =3D AlarmCalendar::resources()->events(mStatus); - mHaveEvents =3D !mEvents.isEmpty(); -//for(int x=3D0; xresource()<<"Event"<<(void*)mEvents[x]; - if (!mTextIcon) - { - mTextIcon =3D new QPixmap(SmallIcon("dialog-information")); - mFileIcon =3D new QPixmap(SmallIcon("document-open")); - mCommandIcon =3D new QPixmap(SmallIcon("system-run")); - mEmailIcon =3D new QPixmap(SmallIcon("mail-message-unread")); - mAudioIcon =3D new QPixmap(SmallIcon("audio-x-generic")); - mIconSize =3D mTextIcon->size().expandedTo(mFileIcon->size()).expa= ndedTo(mCommandIcon->size()).expandedTo(mEmailIcon->size()).expandedTo(mAud= ioIcon->size()); - } - MinuteTimer::connect(this, SLOT(slotUpdateTimeTo())); - AlarmResources* resources =3D AlarmResources::instance(); - connect(resources, SIGNAL(resourceStatusChanged(AlarmResource*,AlarmRe= sources::Change)), - SLOT(slotResourceStatusChanged(AlarmResource*,Alarm= Resources::Change))); - connect(resources, SIGNAL(resourceLoaded(AlarmResource*,bool)), - SLOT(slotResourceLoaded(AlarmResource*,bool))); -} - -int EventListModel::rowCount(const QModelIndex& parent) const -{ - if (parent.isValid()) - return 0; - return mEvents.count(); -} - -int EventListModel::columnCount(const QModelIndex& parent) const -{ - if (parent.isValid()) - return 0; - return ColumnCount; -} - -QModelIndex EventListModel::index(int row, int column, const QModelIndex& = parent) const -{ - if (parent.isValid() || row >=3D mEvents.count()) - return QModelIndex(); - return createIndex(row, column, mEvents[row]); -} - -QVariant EventListModel::data(const QModelIndex& index, int role) const -{ - int column =3D index.column(); - if (role =3D=3D Qt::WhatsThisRole) - return whatsThisText(column); - KAEvent* event =3D static_cast(index.internalPointer()); - if (!event) - return QVariant(); - bool resourceColour =3D false; - switch (column) - { - case TimeColumn: - switch (role) - { - case Qt::BackgroundRole: - resourceColour =3D true; - break; - case Qt::DisplayRole: - { - DateTime due =3D event->expired() ? event->startDateTi= me() : event->nextTrigger(KAEvent::DISPLAY_TRIGGER); - return AlarmTime::alarmTimeText(due); - } - case SortRole: - { - DateTime due =3D event->expired() ? event->startDateTi= me() : event->nextTrigger(KAEvent::DISPLAY_TRIGGER); - return due.isValid() ? due.effectiveKDateTime().toUtc(= ).dateTime() - : QDateTime(QDate(9999,12,31), QT= ime(0,0,0)); - } - default: - break; - } - break; - case TimeToColumn: - switch (role) - { - case Qt::BackgroundRole: - resourceColour =3D true; - break; - case Qt::DisplayRole: - if (event->expired()) - return QString(); - return AlarmTime::timeToAlarmText(event->nextTrigger(K= AEvent::DISPLAY_TRIGGER)); - case SortRole: - { - if (event->expired()) - return -1; - KDateTime now =3D KDateTime::currentUtcDateTime(); - DateTime due =3D event->nextTrigger(KAEvent::DISPLAY_T= RIGGER); - if (due.isDateOnly()) - return now.date().daysTo(due.date()) * 1440; - return (now.secsTo(due.effectiveKDateTime()) + 59) / 6= 0; - } - } - break; - case RepeatColumn: - switch (role) - { - case Qt::BackgroundRole: - resourceColour =3D true; - break; - case Qt::DisplayRole: - return repeatText(event); - case Qt::TextAlignmentRole: - return Qt::AlignHCenter; - case SortRole: - return repeatOrder(event); - } - break; - case ColourColumn: - switch (role) - { - case Qt::BackgroundRole: - switch (event->actionTypes()) - { - case KAEvent::ACT_DISPLAY_COMMAND: - case KAEvent::ACT_DISPLAY: - return event->bgColour(); - case KAEvent::ACT_COMMAND: - if (event->commandError() !=3D KAEvent::CMD_NO= _ERROR) - return Qt::red; - break; - default: - break; - } - break; - case Qt::ForegroundRole: - if (event->commandError() !=3D KAEvent::CMD_NO_ERROR) - { - if (event->actionTypes() =3D=3D KAEvent::ACT_COMMA= ND) - return Qt::white; - QColor colour =3D Qt::red; - int r, g, b; - event->bgColour().getRgb(&r, &g, &b); - if (r > 128 && g <=3D 128 && b <=3D 128) - colour =3D Qt::white; - return colour; - } - break; - case Qt::DisplayRole: - if (event->commandError() !=3D KAEvent::CMD_NO_ERROR) - return QString::fromLatin1("!"); - break; - case SortRole: - { - unsigned i =3D (event->actionTypes() =3D=3D KAEvent::A= CT_DISPLAY) - ? event->bgColour().rgb() : 0; - return QString("%1").arg(i, 6, 10, QLatin1Char('0')); - } - default: - break; - } - break; - case TypeColumn: - switch (role) - { - case Qt::DecorationRole: - { - QVariant v; - v.setValue(*eventIcon(event)); - return v; - } - case Qt::TextAlignmentRole: - return Qt::AlignHCenter; - case Qt::SizeHintRole: - return mIconSize; - case Qt::AccessibleTextRole: -#ifdef __GNUC__ -#warning Implement this -#endif - return QString(); - case ValueRole: - return static_cast(event->actionSubType()); - case SortRole: - return QString("%1").arg(event->actionSubType(), 2, 10= , QLatin1Char('0')); - } - break; - case TextColumn: - switch (role) - { - case Qt::BackgroundRole: - resourceColour =3D true; - break; - case Qt::DisplayRole: - case SortRole: - return AlarmText::summary(*event, 1); - case Qt::ToolTipRole: - return AlarmText::summary(*event, 10); - default: - break; - } - break; - case TemplateNameColumn: - switch (role) - { - case Qt::BackgroundRole: - resourceColour =3D true; - break; - case Qt::DisplayRole: - return event->templateName(); - case SortRole: - return event->templateName().toUpper(); - } - break; - default: - break; - } - - switch (role) - { - case Qt::ForegroundRole: - if (!event->enabled()) - return Preferences::disabledColour(); - if (event->expired()) - return Preferences::archivedColour(); - break; // use the default for normal active alarms - case Qt::ToolTipRole: - // Show the last command execution error message - switch (event->commandError()) - { - case KAEvent::CMD_ERROR: - return i18nc("@info:tooltip", "Command execution faile= d"); - case KAEvent::CMD_ERROR_PRE: - return i18nc("@info:tooltip", "Pre-alarm action execut= ion failed"); - case KAEvent::CMD_ERROR_POST: - return i18nc("@info:tooltip", "Post-alarm action execu= tion failed"); - case KAEvent::CMD_ERROR_PRE_POST: - return i18nc("@info:tooltip", "Pre- and post-alarm act= ion execution failed"); - default: - case KAEvent::CMD_NO_ERROR: - break; - } - break; - case StatusRole: - return event->category(); - case EnabledRole: - return event->enabled(); - default: - break; - } - - if (resourceColour) - { - AlarmResource* resource =3D AlarmResources::instance()->resourceFo= rIncidence(event->id()); - if (resource && resource->colour().isValid()) - return resource->colour(); - } - return QVariant(); -} - -bool EventListModel::setData(const QModelIndex& ix, const QVariant&, int r= ole) -{ - if (ix.isValid() && role =3D=3D Qt::EditRole) - { - int row =3D ix.row(); - emit dataChanged(index(row, 0), index(row, ColumnCount - 1)); - return true; - } - return false; -} - -QVariant EventListModel::headerData(int section, Qt::Orientation orientati= on, int role) const -{ - if (orientation =3D=3D Qt::Horizontal) - { - if (role =3D=3D Qt::DisplayRole) - { - switch (section) - { - case TimeColumn: - return i18nc("@title:column", "Time"); - case TimeToColumn: - return i18nc("@title:column", "Time To"); - case RepeatColumn: - return i18nc("@title:column", "Repeat"); - case ColourColumn: - return QString(); - case TypeColumn: - return QString(); - case TextColumn: - return i18nc("@title:column", "Message, File or Comman= d"); - case TemplateNameColumn: - return i18nc("@title:column Template name", "Name"); - } - } - else if (role =3D=3D Qt::WhatsThisRole) - return whatsThisText(section); - } - return QVariant(); -} - -Qt::ItemFlags EventListModel::flags(const QModelIndex& index) const -{ - if (!index.isValid()) - return Qt::ItemIsEnabled; - return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable |= Qt::ItemIsDragEnabled; -} - -/*************************************************************************= ***** -* Signal every minute that the time-to-alarm values have changed. -*/ -void EventListModel::slotUpdateTimeTo() -{ - int n =3D mEvents.count(); - if (n > 0) - emit dataChanged(index(0, TimeToColumn), index(n - 1, TimeToColumn= )); -} - -/*************************************************************************= ***** -* Called when the colour used to display archived alarms has changed. -*/ -void EventListModel::slotUpdateArchivedColour(const QColor&) -{ - kDebug(); - int firstRow =3D -1; - for (int row =3D 0, end =3D mEvents.count(); row < end; ++row) - { - if (mEvents[row]->category() =3D=3D CalEvent::ARCHIVED) - { - // For efficiency, emit a single signal for each group - // of consecutive archived alarms, rather than a separate - // signal for each alarm. - if (firstRow < 0) - firstRow =3D row; - } - else if (firstRow >=3D 0) - { - emit dataChanged(index(firstRow, 0), index(row - 1, ColumnCoun= t - 1)); - firstRow =3D -1; - } - } - if (firstRow >=3D 0) - emit dataChanged(index(firstRow, 0), index(mEvents.count() - 1, Co= lumnCount - 1)); -} - -/*************************************************************************= ***** -* Called when the colour used to display disabled alarms has changed. -*/ -void EventListModel::slotUpdateDisabledColour(const QColor&) -{ - kDebug(); - int firstRow =3D -1; - for (int row =3D 0, end =3D mEvents.count(); row < end; ++row) - { - if (!mEvents[row]->enabled()) - { - // For efficiency, emit a single signal for each group - // of consecutive disabled alarms, rather than a separate - // signal for each alarm. - if (firstRow < 0) - firstRow =3D row; - } - else if (firstRow >=3D 0) - { - emit dataChanged(index(firstRow, 0), index(row - 1, ColumnCoun= t - 1)); - firstRow =3D -1; - } - } - if (firstRow >=3D 0) - emit dataChanged(index(firstRow, 0), index(mEvents.count() - 1, Co= lumnCount - 1)); -} - -/*************************************************************************= ***** -* Called when the definition of holidays has changed. -* Update the next trigger time for all alarms which are set to recur only = on -* non-holidays. -*/ -void EventListModel::slotUpdateHolidays() -{ - kDebug(); - int firstRow =3D -1; - for (int row =3D 0, end =3D mEvents.count(); row < end; ++row) - { - if (mEvents[row]->holidaysExcluded()) - { - // For efficiency, emit a single signal for each group - // of consecutive alarms to update, rather than a separate - // signal for each alarm. - if (firstRow < 0) - firstRow =3D row; - } - else if (firstRow >=3D 0) - { - emit dataChanged(index(firstRow, TimeColumn), index(row - 1, T= imeColumn)); - emit dataChanged(index(firstRow, TimeToColumn), index(row - 1,= TimeToColumn)); - firstRow =3D -1; - } - } - if (firstRow >=3D 0) - { - emit dataChanged(index(firstRow, TimeColumn), index(mEvents.count(= ) - 1, TimeColumn)); - emit dataChanged(index(firstRow, TimeToColumn), index(mEvents.coun= t() - 1, TimeToColumn)); - } -} - -/*************************************************************************= ***** -* Called when the definition of working hours has changed. -* Update the next trigger time for all alarms which are set to recur only -* during working hours. -*/ -void EventListModel::slotUpdateWorkingHours() -{ - kDebug(); - int firstRow =3D -1; - for (int row =3D 0, end =3D mEvents.count(); row < end; ++row) - { - if (mEvents[row]->workTimeOnly()) - { - // For efficiency, emit a single signal for each group - // of consecutive alarms to update, rather than a separate - // signal for each alarm. - if (firstRow < 0) - firstRow =3D row; - } - else if (firstRow >=3D 0) - { - emit dataChanged(index(firstRow, TimeColumn), index(row - 1, T= imeColumn)); - emit dataChanged(index(firstRow, TimeToColumn), index(row - 1,= TimeToColumn)); - firstRow =3D -1; - } - } - if (firstRow >=3D 0) - { - emit dataChanged(index(firstRow, TimeColumn), index(mEvents.count(= ) - 1, TimeColumn)); - emit dataChanged(index(firstRow, TimeToColumn), index(mEvents.coun= t() - 1, TimeToColumn)); - } -} - -/*************************************************************************= ***** -* Called when the command error status of an alarm has changed. -* Update the visual command error indication. -*/ -void EventListModel::updateCommandError(const QString& eventId) -{ - int row =3D findEvent(eventId); - if (row >=3D 0) - { - QModelIndex ix =3D index(row, ColourColumn); - emit dataChanged(ix, ix); - } -} - -/*************************************************************************= ***** -* Called when loading of a resource is complete. -*/ -void EventListModel::slotResourceLoaded(AlarmResource* resource, bool acti= ve) -{ - if (active) - slotResourceStatusChanged(resource, AlarmResources::Added); -} - -/*************************************************************************= ***** -* Static method called when a resource status has changed. -*/ -void EventListModel::resourceStatusChanged(AlarmResource* resource, AlarmR= esources::Change change) -{ - if (mAlarmInstance) - mAlarmInstance->slotResourceStatusChanged(resource, change); - if (mTemplateInstance) - mTemplateInstance->slotResourceStatusChanged(resource, change); -} - -/*************************************************************************= ***** -* Called when a resource status has changed. -*/ -void EventListModel::slotResourceStatusChanged(AlarmResource* resource, Al= armResources::Change change) -{ - bool added =3D false; - switch (change) - { - case AlarmResources::Added: - kDebug() << resource->resourceName() << "Added"; - added =3D true; - break; - case AlarmResources::Deleted: - kDebug() << resource->resourceName() << "Deleted"; - removeResource(resource); - return; - case AlarmResources::Invalidated: - kDebug() << resource->resourceName() << "Invalidated"; - removeResource(resource); - return; - case AlarmResources::Location: - kDebug() << resource->resourceName() << "Location"; - removeResource(resource); - added =3D true; - break; - case AlarmResources::Enabled: - if (resource->isActive()) - added =3D true; - else - removeResource(resource); - break; - case AlarmResources::Colour: - { - kDebug() << "Colour"; - int firstRow =3D -1; - for (int row =3D 0, end =3D mEvents.count(); row < end; ++ro= w) - { - if (mEvents[row]->resource() =3D=3D resource) - { - // For efficiency, emit a single signal for each group - // of consecutive alarms for the resource, rather than= a separate - // signal for each alarm. - if (firstRow < 0) - firstRow =3D row; - } - else if (firstRow >=3D 0) - { - emit dataChanged(index(firstRow, 0), index(row - 1, Co= lumnCount - 1)); - firstRow =3D -1; - } - } - if (firstRow >=3D 0) - emit dataChanged(index(firstRow, 0), index(mEvents.count()= - 1, ColumnCount - 1)); - return; - } - case AlarmResources::ReadOnly: - case AlarmResources::WrongType: - return; - } - - if (added) - { - KAEvent::List list =3D AlarmCalendar::resources()->events(resource= , mStatus); - for (int i =3D list.count(); --i >=3D 0; ) - { - if (mEvents.indexOf(list[i]) >=3D 0) - list.remove(i); // avoid creating duplicate entries - } - if (!list.isEmpty()) - { - int row =3D mEvents.count(); - beginInsertRows(QModelIndex(), row, row + list.count() - 1); - mEvents +=3D list; - endInsertRows(); - if (!mHaveEvents) - updateHaveEvents(true); - } - } -} - -/*************************************************************************= ***** -* Remove a resource's events from the list. -* This has to be called before the resource is actually deleted or reloade= d. If -* not, timer based updates can occur between the resource being deleted and -* slotResourceStatusChanged(Deleted) being triggered, leading to crashes w= hen -* data from the resource's events is fetched. -*/ -void EventListModel::removeResource(AlarmResource* resource) -{ - kDebug(); - int lastRow =3D -1; - for (int row =3D mEvents.count(); --row >=3D 0; ) - { - AlarmResource* r =3D mEvents[row]->resource(); - if (!r || r =3D=3D resource) - { - // For efficiency, delete each group of consecutive - // alarms for the resource, rather than deleting each - // alarm separately. - if (lastRow < 0) - lastRow =3D row; - } - else if (lastRow >=3D 0) - { - beginRemoveRows(QModelIndex(), row + 1, lastRow); - while (lastRow > row) - mEvents.remove(lastRow--); - endRemoveRows(); - lastRow =3D -1; - } - } - if (lastRow >=3D 0) - { - beginRemoveRows(QModelIndex(), 0, lastRow); - while (lastRow >=3D 0) - mEvents.remove(lastRow--); - endRemoveRows(); - } - if (mHaveEvents && mEvents.isEmpty()) - updateHaveEvents(false); -} - -/*************************************************************************= ***** -* Reload the event list. -*/ -void EventListModel::reload() -{ - // This would be better done by a reset(), but the signals are private= to QAbstractItemModel - if (!mEvents.isEmpty()) - { - beginRemoveRows(QModelIndex(), 0, mEvents.count() - 1); - mEvents.clear(); - endRemoveRows(); - } - KAEvent::List list =3D AlarmCalendar::resources()->events(mStatus); - if (!list.isEmpty()) - { - beginInsertRows(QModelIndex(), 0, list.count() - 1); - mEvents =3D list; - endInsertRows(); - } - if (mHaveEvents =3D=3D mEvents.isEmpty()) - updateHaveEvents(!mHaveEvents); -} - -/*************************************************************************= ***** -* Return the index to a specified event. -*/ -QModelIndex EventListModel::eventIndex(const QString& eventId) const -{ - for (int row =3D 0, end =3D mEvents.count(); row < end; ++row) - { - if (mEvents[row]->id() =3D=3D eventId) - return createIndex(row, 0, mEvents[row]); - } - return QModelIndex(); -} - -/*************************************************************************= ***** -* Return the index to a specified event. -*/ -QModelIndex EventListModel::eventIndex(const KAEvent* event) const -{ - int row =3D mEvents.indexOf(const_cast(event)); - if (row < 0) - return QModelIndex(); - return createIndex(row, 0, mEvents[row]); -} - -/*************************************************************************= ***** -* Add an event to the list. -*/ -void EventListModel::addEvent(KAEvent* event) -{ - if (!(event->category() & mStatus) || mEvents.contains(event)) - return; - int row =3D mEvents.count(); - beginInsertRows(QModelIndex(), row, row); - mEvents +=3D event; - endInsertRows(); - if (!mHaveEvents) - updateHaveEvents(true); -} - -/*************************************************************************= ***** -* Add an event to the list. -*/ -void EventListModel::addEvents(const KAEvent::List& events) -{ - KAEvent::List evs; - for (int i =3D 0, count =3D events.count(); i < count; ++i) - if (events[i]->category() & mStatus) - evs +=3D events[i]; - int row =3D mEvents.count(); - beginInsertRows(QModelIndex(), row, row + evs.count() - 1); - mEvents +=3D evs; - endInsertRows(); - if (!mHaveEvents) - updateHaveEvents(true); -} - -/*************************************************************************= ***** -* Remove an event from the list. -*/ -void EventListModel::removeEvent(int row) -{ - if (row < 0) - return; - beginRemoveRows(QModelIndex(), row, row); - mEvents.remove(row); - endRemoveRows(); - if (mHaveEvents && mEvents.isEmpty()) - updateHaveEvents(false); -} - -/*************************************************************************= ***** -* Notify that an event in the list has been updated. -*/ -bool EventListModel::updateEvent(int row) -{ - if (row < 0) - return false; - emit dataChanged(index(row, 0), index(row, ColumnCount - 1)); - return true; -} - -bool EventListModel::updateEvent(const QString& oldId, KAEvent* newEvent) -{ - int row =3D findEvent(oldId); - if (row < 0) - return false; - mEvents[row] =3D newEvent; - emit dataChanged(index(row, 0), index(row, ColumnCount - 1)); - return true; -} - -/*************************************************************************= ***** -* Find the row of an event in the list, given its unique ID. -*/ -int EventListModel::findEvent(const QString& eventId) const -{ - for (int row =3D 0, end =3D mEvents.count(); row < end; ++row) - { - if (mEvents[row]->id() =3D=3D eventId) - return row; - } - return -1; -} - -/*************************************************************************= ***** -* Return the event for a given row. -*/ -KAEvent* EventListModel::event(int row) const -{ - if (row < 0 || row >=3D mEvents.count()) - return 0; - return mEvents[row]; -} - -/*************************************************************************= ***** -* Return the event referred to by an index. -*/ -KAEvent* EventListModel::event(const QModelIndex& index) -{ - if (!index.isValid()) - return 0; - return static_cast(index.internalPointer()); -} - -/*************************************************************************= ***** -* Return the repetition text. -*/ -QString EventListModel::repeatText(const KAEvent* event) const -{ - QString repeatText =3D event->recurrenceText(true); - if (repeatText.isEmpty()) - repeatText =3D event->repetitionText(true); - return repeatText; -} - -/*************************************************************************= ***** -* Return a string for sorting the repetition column. -*/ -QString EventListModel::repeatOrder(const KAEvent* event) const -{ - int repeatOrder =3D 0; - int repeatInterval =3D 0; - if (event->repeatAtLogin()) - repeatOrder =3D 1; - else - { - repeatInterval =3D event->recurInterval(); - switch (event->recurType()) - { - case KARecurrence::MINUTELY: - repeatOrder =3D 2; - break; - case KARecurrence::DAILY: - repeatOrder =3D 3; - break; - case KARecurrence::WEEKLY: - repeatOrder =3D 4; - break; - case KARecurrence::MONTHLY_DAY: - case KARecurrence::MONTHLY_POS: - repeatOrder =3D 5; - break; - case KARecurrence::ANNUAL_DATE: - case KARecurrence::ANNUAL_POS: - repeatOrder =3D 6; - break; - case KARecurrence::NO_RECUR: - default: - break; - } - } - return QString("%1%2").arg(static_cast('0' + repeatOrder)).arg(r= epeatInterval, 8, 10, QLatin1Char('0')); -} - -/*************************************************************************= ***** -* Return the icon associated with the event's action. -*/ -QPixmap* EventListModel::eventIcon(const KAEvent* event) const -{ - switch (event->actionTypes()) - { - case KAEvent::ACT_EMAIL: - return mEmailIcon; - case KAEvent::ACT_AUDIO: - return mAudioIcon; - case KAEvent::ACT_COMMAND: - return mCommandIcon; - case KAEvent::ACT_DISPLAY: - if (event->actionSubType() =3D=3D KAEvent::FILE) - return mFileIcon; - // fall through to ACT_DISPLAY_COMMAND - case KAEvent::ACT_DISPLAY_COMMAND: - default: - return mTextIcon; - } -} - -/*************************************************************************= ***** -* Returns the QWhatsThis text for a specified column. -*/ -QString EventListModel::whatsThisText(int column) const -{ - switch (column) - { - case TimeColumn: - return i18nc("@info:whatsthis", "Next scheduled date and time = of the alarm"); - case TimeToColumn: - return i18nc("@info:whatsthis", "How long until the next sched= uled trigger of the alarm"); - case RepeatColumn: - return i18nc("@info:whatsthis", "How often the alarm recurs"); - case ColourColumn: - return i18nc("@info:whatsthis", "Background color of alarm mes= sage"); - case TypeColumn: - return i18nc("@info:whatsthis", "Alarm type (message, file, co= mmand or email)"); - case TextColumn: - return i18nc("@info:whatsthis", "Alarm message text, URL of te= xt file to display, command to execute, or email subject line"); - case TemplateNameColumn: - return i18nc("@info:whatsthis", "Name of the alarm template"); - default: - return QString(); - } -} - - -/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D -=3D Class: EventListFilterModel -=3D Base class for all filters on EventListModel. -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D*/ - -EventListFilterModel::EventListFilterModel(EventListModel* baseModel, QObj= ect* parent) - : QSortFilterProxyModel(parent) -{ - setSourceModel(baseModel); - setSortRole(EventListModel::SortRole); - setDynamicSortFilter(true); -} - -/*************************************************************************= ***** -* Return the event referred to by an index. -*/ -KAEvent* EventListFilterModel::event(const QModelIndex& index) const -{ - return static_cast(sourceModel())->event(mapToSource(= index)); -} - -KAEvent* EventListFilterModel::event(int row) const -{ - return static_cast(sourceModel())->event(mapToSource(= index(row, 0))); -} - -/*************************************************************************= ***** -* Return the index to a specified event. -*/ -QModelIndex EventListFilterModel::eventIndex(const QString& eventId) const -{ - return mapFromSource(static_cast(sourceModel())->even= tIndex(eventId)); -} - -/*************************************************************************= ***** -* Return the index to a specified event. -*/ -QModelIndex EventListFilterModel::eventIndex(const KAEvent* event) const -{ - return mapFromSource(static_cast(sourceModel())->even= tIndex(event)); -} - -void EventListFilterModel::slotDataChanged(const QModelIndex& topLeft, con= st QModelIndex& bottomRight) -{ - emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight)); -} - -// vim: et sw=3D4: diff --git a/kalarm/eventlistmodel.h b/kalarm/eventlistmodel.h deleted file mode 100644 index d8f1682..0000000 --- a/kalarm/eventlistmodel.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * eventlistmodel.h - model class for lists of alarms or templates - * Program: kalarm - * Copyright =C2=A9 2007-2012 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef EVENTLISTMODEL_H -#define EVENTLISTMODEL_H - -#include "kalarm.h" - -#include "alarmresources.h" - -#include -#include - -#include -#include -#include - -class QPixmap; -namespace KCal { class Event; } - -using namespace KAlarmCal; - - -class EventListModel : public QAbstractTableModel -{ - Q_OBJECT - public: - enum { // data columns - TimeColumn, TimeToColumn, RepeatColumn, ColourColumn, TypeColu= mn, TextColumn, - TemplateNameColumn, - ColumnCount - }; - enum { // additional roles - StatusRole =3D Qt::UserRole, // return ACTIVE/ARCHIVED - ValueRole, // return numeric value - SortRole, // return the value to use for sor= ting - EnabledRole // return true for enabled alarm, = false for disabled - }; - - static EventListModel* alarms(); - static EventListModel* templates(); - ~EventListModel(); - virtual int rowCount(const QModelIndex& parent =3D QMode= lIndex()) const; - virtual int columnCount(const QModelIndex& parent =3D QM= odelIndex()) const; - virtual QModelIndex index(int row, int column =3D 0, const QMode= lIndex& parent =3D QModelIndex()) const; - virtual QVariant data(const QModelIndex&, int role =3D Qt::Di= splayRole) const; - virtual bool setData(const QModelIndex&, const QVariant& = value, int role =3D Qt::EditRole); - virtual QVariant headerData(int section, Qt::Orientation, int= role =3D Qt::DisplayRole) const; - virtual Qt::ItemFlags flags(const QModelIndex&) const; - static int iconWidth() { return mIconSize.width()= ; } - QModelIndex eventIndex(const KAEvent*) const; - QModelIndex eventIndex(const QString& eventId) const; - void addEvent(KAEvent*); - void addEvents(const KAEvent::List&); - bool updateEvent(KAEvent* event) { retu= rn updateEvent(mEvents.indexOf(event)); } - bool updateEvent(const QString& eventId) { retu= rn updateEvent(findEvent(eventId)); } - bool updateEvent(const QString& oldId, KAEvent* n= ewEvent); - void removeEvent(const KAEvent* event) { remo= veEvent(mEvents.indexOf(const_cast(event))); } - void removeEvent(const QString& eventId) { remo= veEvent(findEvent(eventId)); } - void removeResource(AlarmResource*); - KAEvent* event(int row) const; - static KAEvent* event(const QModelIndex&); - void updateCommandError(const QString& eventId); - bool haveEvents() const { retur= n mHaveEvents; } - static void resourceStatusChanged(AlarmResource*, AlarmR= esources::Change); - - public slots: - void reload(); - - signals: - void haveEventsStatus(bool have); - - private slots: - void slotUpdateTimeTo(); - void slotUpdateArchivedColour(const QColor&); - void slotUpdateDisabledColour(const QColor&); - void slotUpdateHolidays(); - void slotUpdateWorkingHours(); - void slotResourceLoaded(AlarmResource*, bool active); - void slotResourceStatusChanged(AlarmResource*, AlarmResources:= :Change); - - private: - explicit EventListModel(CalEvent::Types, QObject* parent =3D 0); - bool updateEvent(int row); - void removeEvent(int row); - int findEvent(const QString& eventId) const; - void updateHaveEvents(bool have) { mHaveEvents =3D have= ; emit haveEventsStatus(have); } - QString repeatText(const KAEvent*) const; - QString repeatOrder(const KAEvent*) const; - QPixmap* eventIcon(const KAEvent*) const; - QString whatsThisText(int column) const; - - static EventListModel* mAlarmInstance; // the instance contain= ing all alarms - static EventListModel* mTemplateInstance; // the instance contain= ing all templates - static QPixmap* mTextIcon; - static QPixmap* mFileIcon; - static QPixmap* mCommandIcon; - static QPixmap* mEmailIcon; - static QPixmap* mAudioIcon; - static QSize mIconSize; // maximum size of any icon - static int mTimeHourPos; // position of hour within time st= ring, or -1 if leading zeroes included - - KAEvent::List mEvents; - CalEvent::Types mStatus; // types of events contained in this m= odel - bool mHaveEvents;// there are events in this model - - using QObject::event; // prevent "hidden" warning -}; - - -class EventListFilterModel : public QSortFilterProxyModel -{ - Q_OBJECT - public: - explicit EventListFilterModel(EventListModel* baseModel, QObject* = parent =3D 0); - KAEvent* event(int row) const; - KAEvent* event(const QModelIndex&) const; - QModelIndex eventIndex(const KAEvent*) const; - QModelIndex eventIndex(const QString& eventId) const; - = - private slots: - void slotDataChanged(const QModelIndex&, const QModelIndex&); - - private: - using QObject::event; // prevent "hidden" warning -}; - -#endif // EVENTLISTMODEL_H - -// vim: et sw=3D4: diff --git a/kalarm/resourceconfigdialog.cpp b/kalarm/resourceconfigdialog.= cpp deleted file mode 100644 index 4c2c87a..0000000 --- a/kalarm/resourceconfigdialog.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * resourceconfigdialog.cpp - KAlarm resource configuration dialog - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * Based on configdialog.cpp in kdelibs/kresources, - * Copyright (c) 2002 Tobias Koenig - * Copyright (c) 2002 Jan-Pascal van Best - * Copyright (c) 2003 Cornelius Schumacher - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "alarmresource.h" -#include "resourceconfigdialog.moc" -#include "messagebox.h" - -#include - -#include -#include - -#include -#include -#include -#include -#include - -using namespace KRES; - -ResourceConfigDialog::ResourceConfigDialog(QWidget* parent, AlarmResource*= resource) - : KDialog(parent), mResource(resource) -{ - Factory* factory =3D Factory::self(QLatin1String("alarms")); - - QFrame* main =3D new QFrame(this); - setMainWidget(main); - setCaption(i18nc("@title:window", "Calendar Configuration")); - setButtons(Ok | Cancel); - setDefaultButton(Ok); - setModal(true); - - QVBoxLayout* mainLayout =3D new QVBoxLayout(main); - mainLayout->setSpacing(spacingHint()); - - QGroupBox* generalGroupBox =3D new QGroupBox(main); - QGridLayout* gbLayout =3D new QGridLayout; - gbLayout->setSpacing(spacingHint()); - generalGroupBox->setLayout(gbLayout); - - generalGroupBox->setTitle(i18nc("@title:group", "General Settings")); - - gbLayout->addWidget(new QLabel(i18nc("@label:textbox Calendar name", "= Name:"), generalGroupBox), 0, 0); - - mName =3D new KLineEdit(); - gbLayout->addWidget(mName, 0, 1); - - mReadOnly =3D new QCheckBox(i18nc("@option:check", "Read-only"), gener= alGroupBox); - gbLayout->addWidget(mReadOnly, 1, 0, 1, 2); - - mName->setText(mResource->resourceName()); - mReadOnly->setChecked(mResource->readOnly()); - - mainLayout->addWidget(generalGroupBox); - - QGroupBox* resourceGroupBox =3D new QGroupBox(main); - QGridLayout* resourceLayout =3D new QGridLayout; - resourceLayout->setSpacing(spacingHint()); - resourceGroupBox->setLayout(resourceLayout); - - resourceGroupBox->setTitle(i18nc("@title:group", "%1 Calendar Settings", - factory->typeName(resource->type()))); - mainLayout->addWidget(resourceGroupBox); - - mainLayout->addStretch(); - - mConfigWidget =3D factory->configWidget(resource->type(), resourceGrou= pBox); - if (mConfigWidget) - { - resourceLayout->addWidget(mConfigWidget); - mConfigWidget->setInEditMode(false); - mConfigWidget->loadSettings(mResource); - mConfigWidget->show(); - connect(mConfigWidget, SIGNAL(setReadOnly(bool)), SLOT(setReadOnly= (bool))); - } - - connect(mName, SIGNAL(textChanged(QString)), SLOT(slotNameChanged(QStr= ing))); - - slotNameChanged(mName->text()); - setMinimumSize(sizeHint()); -} - -void ResourceConfigDialog::setInEditMode(bool value) -{ - if (mConfigWidget) - mConfigWidget->setInEditMode(value); -} - -void ResourceConfigDialog::slotNameChanged(const QString& text) -{ - enableButtonOk(!text.isEmpty()); -} - -void ResourceConfigDialog::setReadOnly(bool value) -{ - mReadOnly->setChecked(value); -} - -void ResourceConfigDialog::accept() -{ - if (mName->text().isEmpty()) - { - KAMessageBox::sorry(this, i18nc("@info", "Please enter a calendar = name.")); - return; - } - - mResource->startReconfig(); - mResource->setResourceName(mName->text()); - mResource->setReadOnly(mReadOnly->isChecked()); - - if (mConfigWidget) - { - // First save generic information - // Also save setting of specific resource type - mConfigWidget->saveSettings(mResource); - } - mResource->applyReconfig(); - - KDialog::accept(); -} - -// vim: et sw=3D4: diff --git a/kalarm/resourceconfigdialog.h b/kalarm/resourceconfigdialog.h deleted file mode 100644 index 42b641f..0000000 --- a/kalarm/resourceconfigdialog.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * resourceconfigdialog.h - KAlarm resource configuration dialog - * Program: kalarm - * Copyright =C2=A9 2006 by David Jarvie - * Based on configdialog.cpp in kdelibs/kresources, - * Copyright (c) 2002 Tobias Koenig - * Copyright (c) 2002 Jan-Pascal van Best - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef RESOURCECONFIGDIALOG_H -#define RESOURCECONFIGDIALOG_H - -#include - -class KLineEdit; -class QCheckBox; - -namespace KRES { - class ConfigWidget; -} -class AlarmResource; - -class ResourceConfigDialog : public KDialog -{ - Q_OBJECT - public: - // Resource=3D0: create new resource - ResourceConfigDialog(QWidget* parent, AlarmResource* resource); - - void setInEditMode(bool value); - - protected Q_SLOTS: - void accept(); - void setReadOnly(bool value); - void slotNameChanged(const QString& text); - - private: - KRES::ConfigWidget* mConfigWidget; - AlarmResource* mResource; - KLineEdit* mName; - QCheckBox* mReadOnly; -}; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resourcemodelview.cpp b/kalarm/resourcemodelview.cpp deleted file mode 100644 index 847e743..0000000 --- a/kalarm/resourcemodelview.cpp +++ /dev/null @@ -1,542 +0,0 @@ -/* - * resourcemodelview.cpp - model/view classes for alarm resource lists - * Program: kalarm - * Copyright =C2=A9 2007-2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "messagebox.h" -#include "preferences.h" -#include "resourcemodelview.moc" - -#include -#include -#include - -#include -#include -#include -#include -#include - - -ResourceModel* ResourceModel::mInstance =3D 0; - - -ResourceModel* ResourceModel::instance(QObject* parent) -{ - if (!mInstance) - mInstance =3D new ResourceModel(parent); - return mInstance; -} - -ResourceModel::ResourceModel(QObject* parent) - : QAbstractListModel(parent) -{ - refresh(); - AlarmResources* resources =3D AlarmResources::instance(); - connect(resources, SIGNAL(signalResourceModified(AlarmResource*)), SLO= T(updateResource(AlarmResource*))); - connect(resources, SIGNAL(standardResourceChange(CalEvent::Type)), SLO= T(slotStandardChanged(CalEvent::Type))); - connect(resources, SIGNAL(resourceStatusChanged(AlarmResource*,AlarmRe= sources::Change)), SLOT(slotStatusChanged(AlarmResource*,AlarmResources::Ch= ange))); - connect(resources, SIGNAL(resourceLoaded(AlarmResource*,bool)), SLOT(s= lotLoaded(AlarmResource*,bool))); -} - -int ResourceModel::rowCount(const QModelIndex& parent) const -{ - if (parent.isValid()) - return 0; - return mResources.count(); -} - -QModelIndex ResourceModel::index(int row, int column, const QModelIndex& p= arent) const -{ - if (parent.isValid() || row >=3D mResources.count()) - return QModelIndex(); - return createIndex(row, column, mResources[row]); -} - -QVariant ResourceModel::data(const QModelIndex& index, int role) const -{ - if (!index.isValid()) - return QVariant(); - AlarmResource* resource =3D static_cast(index.internal= Pointer()); - if (!resource) - return QVariant(); - switch (role) - { - case Qt::DisplayRole: - return resource->resourceName(); - case Qt::CheckStateRole: - return resource->isEnabled() ? Qt::Checked : Qt::Unchecked; - case Qt::ForegroundRole: - { - QColor colour; - switch (resource->alarmType()) - { - case CalEvent::ACTIVE: colour =3D KColorScheme(QPalette= ::Active).foreground(KColorScheme::NormalText).color(); break; - case CalEvent::ARCHIVED: colour =3D Preferences::archived= Colour(); break; - case CalEvent::TEMPLATE: colour =3D KColorScheme(QPalette= ::Active).foreground(KColorScheme::LinkText).color(); break; - default: break; - } - if (colour.isValid()) - return resource->readOnly() ? KColorUtils::lighten(colour,= 0.25) : colour; - break; - } - case Qt::BackgroundRole: - if (resource->colour().isValid()) - return resource->colour(); - break; - case Qt::FontRole: - { - if (!resource->isEnabled() || !resource->standardResource()) - break; - QFont font =3D mFont; - font.setBold(true); - return font; - } - case Qt::ToolTipRole: - { - QString name =3D '@' + resource->resourceName(); // insert m= arkers for stripping out name - QString type =3D '@' + resource->displayType(); - bool inactive =3D !resource->isActive(); - QString disabled =3D resource->isWrongAlarmType() ? i18nc("@in= fo/plain", "Disabled (wrong alarm type)") : i18nc("@info/plain", "Disabled"= ); - QString readonly =3D i18nc("@info/plain", "Read-only"); - if (inactive && resource->readOnly()) - return i18nc("@info:tooltip", - "%1" - "%2: %3" - "%4, %5", - name, type, resource->displayLocation(), disa= bled, readonly); - if (inactive || resource->readOnly()) - return i18nc("@info:tooltip", - "%1" - "%2: %3" - "%4", - name, type, resource->displayLocation(), - (inactive ? disabled : readonly)); - return i18nc("@info:tooltip", - "%1" - "%2: %3", - name, type, resource->displayLocation()); - } - default: - break; - } - return QVariant(); -} - -/*************************************************************************= ***** -* Set the font to use for all items, or the checked state of one item. -* The font must always be set at initialisation. -*/ -bool ResourceModel::setData(const QModelIndex& index, const QVariant& valu= e, int role) -{ - mErrorPrompt.clear(); - if (role =3D=3D Qt::FontRole) - { - // Set the font used in all views. - // This enables data(index, Qt::FontRole) to return bold when appr= opriate. - mFont =3D value.value(); - return true; - } - if (role !=3D Qt::CheckStateRole || !index.isValid()) - return false; - AlarmResource* resource =3D static_cast(index.internal= Pointer()); - if (!resource) - return false; - Qt::CheckState state =3D static_cast(value.toInt()); - bool active =3D (state =3D=3D Qt::Checked); - bool saveChange =3D false; - AlarmResources* resources =3D AlarmResources::instance(); - if (active) - { - // Enable the resource - resource->setActive(true); // enable it now so that load() wil= l work - saveChange =3D resources->load(resource); - resource->setActive(false); // reset so that setEnabled() will = work - } - else - { - // Disable the resource - saveChange =3D resource->saveAndClose(); // close resource after= it is saved - } - if (saveChange) - resource->setEnabled(active); - emit dataChanged(index, index); - return true; -} - -Qt::ItemFlags ResourceModel::flags(const QModelIndex&) const -{ - return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserChecka= ble; -} - -/*************************************************************************= ***** -* Return the resource referred to by an index. -*/ -AlarmResource* ResourceModel::resource(const QModelIndex& index) const -{ - if (!index.isValid()) - return 0; - return static_cast(index.internalPointer()); -} - -/*************************************************************************= ***** -* Emit a signal that a resource has changed. -*/ -void ResourceModel::notifyChange(const QModelIndex& index) -{ - if (index.isValid()) - emit dataChanged(index, index); -} - -/*************************************************************************= ***** -* Reload the resources list. -*/ -void ResourceModel::refresh() -{ - // This would be better done by a reset(), but the signals are private= to QAbstractItemModel - if (!mResources.isEmpty()) - { - beginRemoveRows(QModelIndex(), 0, mResources.count() - 1); - mResources.clear(); - endRemoveRows(); - } - QList newResources; - AlarmResourceManager* manager =3D AlarmResources::instance()->resource= Manager(); - for (AlarmResourceManager::Iterator it =3D manager->begin(); it !=3D = manager->end(); ++it) - newResources +=3D *it; - if (!newResources.isEmpty()) - { - beginInsertRows(QModelIndex(), 0, newResources.count() - 1); - mResources =3D newResources; - endInsertRows(); - } -} - -/*************************************************************************= ***** -* Add the specified resource to the list. -*/ -void ResourceModel::addResource(AlarmResource* resource) -{ - int row =3D mResources.count(); - beginInsertRows(QModelIndex(), row, row); - mResources +=3D resource; - endInsertRows(); -} - -/*************************************************************************= ***** -* Delete the specified resource from the list. -*/ -void ResourceModel::removeResource(AlarmResource* resource) -{ - int row =3D mResources.indexOf(resource); - if (row >=3D 0) - { - beginRemoveRows(QModelIndex(), row, row); - mResources.removeAt(row); - endRemoveRows(); - } -} - -/*************************************************************************= ***** -* Called when the resource has been updated , to update the -* active status displayed for the resource item. -*/ -void ResourceModel::updateResource(AlarmResource* resource) -{ - int row =3D mResources.indexOf(resource); - if (row >=3D 0) - { - QModelIndex ix =3D index(row, 0, QModelIndex()); - emit dataChanged(ix, ix); - } -} - -/*************************************************************************= ***** -* Called when a different resource has been set as the standard resource. -*/ -void ResourceModel::slotStandardChanged(CalEvent::Type type) -{ - for (int row =3D 0, end =3D mResources.count(); row < end; ++row) - { - if (mResources[row]->alarmType() =3D=3D type) - { - QModelIndex ix =3D index(row, 0, QModelIndex()); - emit dataChanged(ix, ix); - } - } -} - -/*************************************************************************= ***** -* Called when a resource has completed loading. -* Check in case its status has changed. -*/ -void ResourceModel::slotLoaded(AlarmResource* resource, bool active) -{ - if (active) - updateResource(resource); -} - -/*************************************************************************= ***** -* Called when a resource status has changed, to update the list. -*/ -void ResourceModel::slotStatusChanged(AlarmResource* resource, AlarmResour= ces::Change change) -{ - switch (change) - { - case AlarmResources::Added: - addResource(resource); - break; - case AlarmResources::Enabled: - case AlarmResources::ReadOnly: - case AlarmResources::Colour: - updateResource(resource); - break; - default: - break; - } -} - - -/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D -=3D Class: ResourceFilterModel -=3D Proxy model for filtering resource lists. -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D*/ - -ResourceFilterModel::ResourceFilterModel(QAbstractItemModel* baseModel, QO= bject* parent) - : QSortFilterProxyModel(parent), - mResourceType(CalEvent::EMPTY) -{ - setSourceModel(baseModel); -} - -void ResourceFilterModel::setFilter(CalEvent::Type type) -{ - if (type !=3D mResourceType) - { - mResourceType =3D type; - invalidateFilter(); - } -} - -bool ResourceFilterModel::filterAcceptsRow(int sourceRow, const QModelInde= x&) const -{ - return static_cast(sourceModel())->resource(sourceMode= l()->index(sourceRow, 0))->alarmType() =3D=3D mResourceType; -} - -/*************************************************************************= ***** -* Return the resource referred to by an index. -*/ -AlarmResource* ResourceFilterModel::resource(int row) const -{ - return static_cast(sourceModel())->resource(mapToSourc= e(index(row, 0))); -} - -AlarmResource* ResourceFilterModel::resource(const QModelIndex& index) con= st -{ - return static_cast(sourceModel())->resource(mapToSourc= e(index)); -} - -/*************************************************************************= ***** -* Emit a signal that a resource has changed. -*/ -void ResourceFilterModel::notifyChange(int row) -{ - static_cast(sourceModel())->notifyChange(mapToSource(i= ndex(row, 0))); -} - -void ResourceFilterModel::notifyChange(const QModelIndex& index) -{ - static_cast(sourceModel())->notifyChange(mapToSource(i= ndex)); -} - - -/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D -=3D Class: ResourceDelegate -=3D Model/view delegate for resource list. -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D*/ - -/*************************************************************************= ***** -* Process a change of state of the checkbox for a resource. -*/ -bool ResourceDelegate::editorEvent(QEvent* event, QAbstractItemModel* mode= l, const QStyleOptionViewItem& option, const QModelIndex& index) -{ - if (!(model->flags(index) & Qt::ItemIsEnabled)) - return false; - if (event->type() =3D=3D QEvent::MouseButtonRelease - || event->type() =3D=3D QEvent::MouseButtonDblClick) - { - const int textMargin =3D QApplication::style()->pixelMetric(QStyle= ::PM_FocusFrameHMargin) + 1; - QRect checkRect =3D QStyle::alignedRect(option.direction, Qt::Alig= nLeft | Qt::AlignVCenter, - check(option, option.rect, Q= t::Checked).size(), - QRect(option.rect.x() + text= Margin, option.rect.y(), option.rect.width(), option.rect.height())); - if (!checkRect.contains(static_cast(event)->pos())) - return false; - if (event->type() =3D=3D QEvent::MouseButtonDblClick) - return true; // ignore double clicks - } - else if (event->type() =3D=3D QEvent::KeyPress) - { - if (static_cast(event)->key() !=3D Qt::Key_Space - && static_cast(event)->key() !=3D Qt::Key_Select) - return false; - } - else - return false; - - QVariant value =3D index.data(Qt::CheckStateRole); - if (!value.isValid()) - return false; - Qt::CheckState state =3D (static_cast(value.toInt()) = =3D=3D Qt::Checked ? Qt::Unchecked : Qt::Checked); - if (state =3D=3D Qt::Unchecked) - { - // The resource is to be disabled. - // Check for eligibility. - AlarmResource* resource =3D static_cast(mode= l)->resource(index); - if (!resource) - return false; - if (resource->standardResource()) - { - // It's the standard resource for its type. - if (resource->alarmType() =3D=3D CalEvent::ACTIVE) - { - KAMessageBox::sorry(static_cast(parent()), - i18nc("@info", "You cannot disable you= r default active alarm calendar.")); - return false; - - } - if (resource->alarmType() =3D=3D CalEvent::ARCHIVED && Prefe= rences::archivedKeepDays()) - { - // Only allow the archived alarms standard resource to be = disabled if - // we're not saving archived alarms. - KAMessageBox::sorry(static_cast(parent()), - i18nc("@info", "You cannot disable you= r default archived alarm calendar " - "while expired alarms are config= ured to be kept.")); - return false; - } - if (KAMessageBox::warningContinueCancel(static_cast(= parent()), - i18nc("@info", "Do you= really want to disable your default calendar?")) - =3D=3D KMessageBox::Cancel) - return false; - } - } - return model->setData(index, state, Qt::CheckStateRole); -} - - -/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D -=3D Class: ResourceView -=3D View displaying a list of resources. -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D*/ - -void ResourceView::setModel(QAbstractItemModel* model) -{ - model->setData(QModelIndex(), viewOptions().font, Qt::FontRole); - QListView::setModel(model); - setItemDelegate(new ResourceDelegate(this)); -} - -/*************************************************************************= ***** -* Return the resource for a given row. -*/ -AlarmResource* ResourceView::resource(int row) const -{ - return static_cast(model())->resource(row); -} - -AlarmResource* ResourceView::resource(const QModelIndex& index) const -{ - return static_cast(model())->resource(index); -} - -/*************************************************************************= ***** -* Emit a signal that a resource has changed. -*/ -void ResourceView::notifyChange(int row) const -{ - static_cast(model())->notifyChange(row); -} - -void ResourceView::notifyChange(const QModelIndex& index) const -{ - static_cast(model())->notifyChange(index); -} - -/*************************************************************************= ***** -* Called when a mouse button is released. -* Any currently selected resource is deselected. -*/ -void ResourceView::mouseReleaseEvent(QMouseEvent* e) -{ - if (!indexAt(e->pos()).isValid()) - clearSelection(); - QListView::mouseReleaseEvent(e); -} - -/*************************************************************************= ***** -* Called when a ToolTip or WhatsThis event occurs. -*/ -bool ResourceView::viewportEvent(QEvent* e) -{ - if (e->type() =3D=3D QEvent::ToolTip && isActiveWindow()) - { - QHelpEvent* he =3D static_cast(e); - QModelIndex index =3D indexAt(he->pos()); - QVariant value =3D model()->data(index, Qt::ToolTipRole); - if (qVariantCanConvert(value)) - { - QString toolTip =3D value.toString(); - int i =3D toolTip.indexOf('@'); - if (i > 0) - { - int j =3D toolTip.indexOf(QRegExp("<(nl|br)", Qt::CaseInse= nsitive), i + 1); - int k =3D toolTip.indexOf('@', j); - QString name =3D toolTip.mid(i + 1, j - i - 1); - value =3D model()->data(index, Qt::FontRole); - QFontMetrics fm(qvariant_cast(value).resolve(viewOp= tions().font)); - int textWidth =3D fm.boundingRect(name).width() + 1; - const int margin =3D QApplication::style()->pixelMetric(QS= tyle::PM_FocusFrameHMargin) + 1; - QStyleOptionButton opt; - opt.QStyleOption::operator=3D(viewOptions()); - opt.rect =3D rectForIndex(index); - int checkWidth =3D QApplication::style()->subElementRect(Q= Style::SE_ViewItemCheckIndicator, &opt).width(); - int left =3D spacing() + 3*margin + checkWidth + viewOptio= ns().decorationSize.width(); // left offset of text - int right =3D left + textWidth; - if (left >=3D horizontalOffset() + spacing() - && right <=3D horizontalOffset() + width() - spacing() - = 2*frameWidth()) - { - // The whole of the resource name is already displayed, - // so omit it from the tooltip. - if (k > 0) - toolTip.remove(i, k + 1 - i); - } - else - { - toolTip.remove(k, 1); - toolTip.remove(i, 1); - } - } - QToolTip::showText(he->globalPos(), toolTip, this); - return true; - } - } - return QListView::viewportEvent(e); -} - -// vim: et sw=3D4: diff --git a/kalarm/resourcemodelview.h b/kalarm/resourcemodelview.h deleted file mode 100644 index f757313..0000000 --- a/kalarm/resourcemodelview.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * resourcemodelview.h - model/view classes for alarm resource lists - * Program: kalarm - * Copyright =C2=A9 2007,2008,2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef RESOURCEMODELVIEW_H -#define RESOURCEMODELVIEW_H - -#include "kalarm.h" - -#include "resources/alarmresource.h" -#include "resources/alarmresources.h" - -#include -#include -#include -#include -#include -#include - -using namespace KAlarmCal; - -class ResourceModel : public QAbstractListModel -{ - Q_OBJECT - public: - static ResourceModel* instance(QObject* parent =3D 0); - virtual int rowCount(const QModelIndex& parent =3D QModelInde= x()) const; - virtual QModelIndex index(int row, int column, const QModelIndex& = parent) const; - virtual QVariant data(const QModelIndex&, int role =3D Qt::Display= Role) const; - virtual bool setData(const QModelIndex&, const QVariant& value= , int role =3D Qt::EditRole); - virtual Qt::ItemFlags flags(const QModelIndex&) const; - AlarmResource* resource(const QModelIndex&) const; - void removeResource(AlarmResource*); - void notifyChange(const QModelIndex&); - - private slots: - void refresh(); - void addResource(AlarmResource*); - void updateResource(AlarmResource*); - void slotStandardChanged(CalEvent::Type); - void slotLoaded(AlarmResource*, bool active); - void slotStatusChanged(AlarmResource*, AlarmResources:= :Change); - - private: - explicit ResourceModel(QObject* parent =3D 0); - - static ResourceModel* mInstance; - QList mResources; - QString mErrorPrompt; - QFont mFont; -}; - - -class ResourceFilterModel : public QSortFilterProxyModel -{ - Q_OBJECT - public: - ResourceFilterModel(QAbstractItemModel* baseModel, QObject* parent= ); - void setFilter(CalEvent::Type); - AlarmResource* resource(int row) const; - AlarmResource* resource(const QModelIndex&) const; - void notifyChange(int row); - void notifyChange(const QModelIndex&); - - protected: - virtual bool filterAcceptsRow(int sourceRow, const QModelIndex& so= urceParent) const; - - private: - CalEvent::Type mResourceType; -}; - - -class ResourceView : public QListView -{ - Q_OBJECT - public: - explicit ResourceView(QWidget* parent =3D 0) : QListView(parent) = {} - virtual void setModel(QAbstractItemModel*); - AlarmResource* resource(int row) const; - AlarmResource* resource(const QModelIndex&) const; - void notifyChange(int row) const; - void notifyChange(const QModelIndex&) const; - - protected: - virtual void mouseReleaseEvent(QMouseEvent*); - virtual bool viewportEvent(QEvent*); -}; - - -class ResourceDelegate : public QItemDelegate -{ - Q_OBJECT - public: - explicit ResourceDelegate(ResourceView* parent =3D 0) : QItemDele= gate(parent) {} - virtual bool editorEvent(QEvent*, QAbstractItemModel*, const QStyl= eOptionViewItem&, const QModelIndex&); -}; - -#endif // RESOURCEMODELVIEW_H - -// vim: et sw=3D4: diff --git a/kalarm/resources/CMakeLists.txt b/kalarm/resources/CMakeLists.= txt deleted file mode 100644 index 9b4bd85..0000000 --- a/kalarm/resources/CMakeLists.txt +++ /dev/null @@ -1,79 +0,0 @@ -########### next target ############### -set(kalarm_resources_LIB_SRCS - alarmresource.cpp = - alarmresources.cpp = - resourcelocal.cpp = - resourcelocalwidget.cpp = - resourcelocaldir.cpp = - resourcelocaldirwidget.cpp = - resourceremote.cpp = - resourceremotewidget.cpp = - resourcewidget.cpp = -) - - -kde4_add_library(kalarm_resources ${LIBRARY_TYPE} ${kalarm_resources_LIB_S= RCS}) - -target_link_libraries(kalarm_resources - ${KDEPIMLIBS_KALARMCAL_LIBS} - ${KDEPIMLIBS_KRESOURCES_LIBS} - ${KDEPIMLIBS_KABC_LIBS} - ${KDEPIMLIBS_KCAL_LIBS} - ${KDE4_KIO_LIBS} - ) -target_link_libraries(kalarm_resources LINK_INTERFACE_LIBRARIES - ${KDEPIMLIBS_KALARMCAL_LIBS} - ${KDEPIMLIBS_KRESOURCES_LIBS} - ${KDEPIMLIBS_KABC_LIBS} - ${KDEPIMLIBS_KCAL_LIBS} - ${KDE4_KIO_LIBS} - ) - -set_target_properties(kalarm_resources PROPERTIES = - VERSION ${KDEPIM_LIB_VERSION} = - SOVERSION ${KDEPIM_LIB_SOVERSION} = -) -install(TARGETS kalarm_resources ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY N= AMELINK_SKIP) - -install(FILES kalarm_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/k= resources) - - -########### next target ############### - -set(kalarm_local_PART_SRCS resourcelocal_plugin.cpp) - - -kde4_add_plugin(kalarm_local ${kalarm_local_PART_SRCS}) - -target_link_libraries(kalarm_local kalarm_resources ${KDEPIMLIBS_KCAL_LIBS= } ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY}) - -install(TARGETS kalarm_local DESTINATION ${PLUGIN_INSTALL_DIR}) - -install(FILES local.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kresource= s/alarms) - -########### next target ############### - -set(kalarm_localdir_PART_SRCS resourcelocaldir_plugin.cpp) - - -kde4_add_plugin(kalarm_localdir ${kalarm_localdir_PART_SRCS}) - -target_link_libraries(kalarm_localdir kalarm_resources ${KDEPIMLIBS_KCAL_L= IBS} ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY}) - -install(TARGETS kalarm_localdir DESTINATION ${PLUGIN_INSTALL_DIR}) - -install(FILES localdir.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kresou= rces/alarms) - -########### next target ############### - -set(kalarm_remote_PART_SRCS resourceremote_plugin.cpp) - - -kde4_add_plugin(kalarm_remote ${kalarm_remote_PART_SRCS}) - -target_link_libraries(kalarm_remote kalarm_resources ${KDEPIMLIBS_KCAL_LIB= S} ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY}) - -install(TARGETS kalarm_remote DESTINATION ${PLUGIN_INSTALL_DIR}) - -install(FILES remote.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kresourc= es/alarms) - diff --git a/kalarm/resources/alarmresource.cpp b/kalarm/resources/alarmres= ource.cpp deleted file mode 100644 index 898bff5..0000000 --- a/kalarm/resources/alarmresource.cpp +++ /dev/null @@ -1,444 +0,0 @@ -/* - * alarmresource.cpp - base class for a KAlarm alarm calendar resource - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "alarmresource.moc" -using namespace KCal; -#include "alarmresources.h" - -#include -#include -#include - -#include -#include -#include -#include - - - -void (*AlarmResource::mCalIDFunction)(CalendarLocal&) = =3D 0; -void (*AlarmResource::mCustomEventFunction)(AlarmResou= rce*, CalendarLocal*) =3D 0; -KACalendar::Compat (*AlarmResource::mFixFunction)(CalendarLocal&, const QS= tring&, AlarmResource*, AlarmResource::FixFunc, bool* wrongType) =3D 0; -int AlarmResource::mDebugArea =3D 0; -bool AlarmResource::mNoGui =3D false; - - -AlarmResource::AlarmResource() - : ResourceCached(), - mLock(0), - mType(static_cast(0)), // invalid - mStandard(false), - mCloseAfterSave(false), - mWrongAlarmType(false), - mCompatibility(KACalendar::Incompatible), - mReconfiguring(0), - mLoaded(false), - mLoading(false) -{ - // Prevent individual events being set read-only when loading a read-o= nly resource - setNoReadOnlyOnLoad(true); - init(); -} - -AlarmResource::AlarmResource(const KConfigGroup& group) - : ResourceCached(group), - mLock(0), - mType(static_cast(0)), // invalid - mStandard(false), - mCloseAfterSave(false), - mWrongAlarmType(false), - mCompatibility(KACalendar::Incompatible), - mReconfiguring(0), - mLoaded(false), - mLoading(false) -{ - // Prevent individual events being set read-only when loading a read-o= nly resource - setNoReadOnlyOnLoad(true); - - ResourceCached::readConfig(group); - int type =3D group.readEntry("AlarmType", static_cast(CalEvent::A= CTIVE)); - switch (type) - { - case CalEvent::ACTIVE: - case CalEvent::ARCHIVED: - case CalEvent::TEMPLATE: - mType =3D static_cast(type); - mStandard =3D group.readEntry("Standard", true); - break; - default: - break; - } - mColour =3D group.readEntry("Color", QColor()); - init(); -} - -AlarmResource::AlarmResource(CalEvent::Type type) - : ResourceCached(), - mLock(0), - mType(type), - mStandard(false), - mCloseAfterSave(false), - mCompatibility(KACalendar::Incompatible), - mReconfiguring(0), - mLoaded(false), - mLoading(false) -{ - init(); -} - -void AlarmResource::init() -{ - enableChangeNotification(); - if (mType =3D=3D CalEvent::ARCHIVED) - { - // Prevent unnecessary multiple saves of archived alarm resources. - // When multiple alarms are deleted as a group, the archive - // resource would be saved once for each alarm. Ironically, setting - // the resource to be automatically saved will prevent this, since - // automatic saving delays for a second after each change before - // actually saving the resource, thereby ensuring that they are - // saved as a group. - setSavePolicy(SaveAlways); - } -} - -AlarmResource::~AlarmResource() -{ - delete mLock; -} - -void AlarmResource::writeConfig(KConfigGroup& group) -{ - group.writeEntry("AlarmType", static_cast(mType)); - if (mColour.isValid()) - group.writeEntry("Color", mColour); - else - group.deleteEntry("Color"); - group.writeEntry("Standard", mStandard); - ResourceCached::writeConfig(group); - ResourceCalendar::writeConfig(group); -} - -void AlarmResource::startReconfig() -{ - mOldReadOnly =3D ResourceCached::readOnly(); - mNewReadOnly =3D mOldReadOnly; - mReconfiguring =3D 1; -} - -void AlarmResource::applyReconfig() -{ - if (!mReconfiguring) - return; - if (mReconfiguring =3D=3D 1) - { - // Called before derived classes do their stuff - ResourceCached::setReadOnly(mNewReadOnly); - mReconfiguring =3D 2; - } - else - { - // Called when derived classes have done their stuff - setReadOnly(mNewReadOnly); - mReconfiguring =3D 0; - } -} - -/*************************************************************************= ***** -* If a function is defined to convert alarms to the current format, call i= t. -* Set the resource to read-only if it isn't the current format version, or= if -* its format is unknown. -*/ -void AlarmResource::checkCompatibility(const QString& filename) -{ - bool wrongType =3D false; - bool oldReadOnly =3D readOnly(); - mCompatibility =3D KACalendar::Incompatible; // assume the worst - if (mFixFunction) - { - // Check whether the version is compatible (and convert it if desi= red) - mCompatibility =3D (*mFixFunction)(*calendar(), filename, this, PR= OMPT, &wrongType); - if (wrongType) - kDebug(KARES_DEBUG) << resourceName() << ": contains wrong ala= rm type(s)"; - if (mCompatibility =3D=3D KACalendar::Converted) - { - // Set mCompatibility first to ensure that readOnly() returns - // the correct value and that save() therefore works. - mCompatibility =3D KACalendar::Current; - save(); - } - if (mCompatibility !=3D KACalendar::Current && mCompatibility != =3D KACalendar::ByEvent) - { - // It's not in the current KAlarm format, so it will be read-o= nly to prevent incompatible updates - kDebug(KARES_DEBUG) << resourceName() << ": opened read-only (= not current KAlarm format)"; - } - } - setWrongAlarmType(wrongType); - if (readOnly() !=3D oldReadOnly) - emit readOnlyChanged(this); // the effective read-only status ha= s changed -} - -/*************************************************************************= ***** -* If a function is defined to convert alarms to the current format, call i= t to -* convert an individual file within the overall resource. -*/ -KACalendar::Compat AlarmResource::checkCompatibility(CalendarLocal& calend= ar, const QString& filename, FixFunc conv, bool* wrongType) -{ - if (wrongType) - *wrongType =3D false; - KACalendar::Compat compat =3D KACalendar::Incompatible; // assume th= e worst - if (mFixFunction) - { - // Check whether the version is compatible (and convert it if desi= red) - compat =3D (*mFixFunction)(calendar, filename, this, conv, wrongTy= pe); - if (compat =3D=3D KACalendar::Converted) - calendar.save(filename); - } - return compat; -} - -KACalendar::Compat AlarmResource::compatibility(const Event* event) const -{ - if (mCompatibility !=3D KACalendar::ByEvent) - return mCompatibility; - CompatibilityMap::ConstIterator it =3D mCompatibilityMap.find(event); - if (it =3D=3D mCompatibilityMap.constEnd()) - return KACalendar::Incompatible; // event not found!?! - assume= the worst - return it.value(); -} - -/*************************************************************************= ***** -* Set whether the resource contains only the wrong alarm types. -* If the wrong types, disable the resource. -*/ -void AlarmResource::setWrongAlarmType(bool wrongType, bool emitSignal) -{ - if (wrongType !=3D mWrongAlarmType) - { - mWrongAlarmType =3D wrongType; - if (emitSignal) - emit wrongAlarmTypeChanged(this); - if (mWrongAlarmType) - setEnabled(false); - } -} - -/*************************************************************************= ***** -* If a function is defined to update KAlarm event instances, call it. -*/ -void AlarmResource::updateCustomEvents(bool useCalendar) -{ - if (mCustomEventFunction && isEnabled()) - (*mCustomEventFunction)(this, useCalendar ? calendar() : 0); -} - -bool AlarmResource::writable(const Event* event) const -{ - return isActive() && !KCal::ResourceCached::readOnly() - && compatibility(event) =3D=3D KACalendar::Current; -} - -bool AlarmResource::readOnly() const -{ - return KCal::ResourceCached::readOnly() - || (isActive() && mCompatibility !=3D KACalendar::Current && mCo= mpatibility !=3D KACalendar::ByEvent); -} - -void AlarmResource::setReadOnly(bool ronly) -{ - if (mReconfiguring =3D=3D 1) - { - mNewReadOnly =3D ronly; - return; - } - kDebug(KARES_DEBUG) << ronly; - bool oldRCronly =3D (mReconfiguring =3D=3D 2) ? mOldReadOnly : Resourc= eCached::readOnly(); - bool oldronly =3D (oldRCronly || (mCompatibility !=3D KACalendar::Curr= ent && mCompatibility !=3D KACalendar::ByEvent)); - if (!ronly && isActive()) - { - // Trying to change the resource to read-write. - // Only allow this if it is in, or can be converted to, the curren= t KAlarm format. - switch (mCompatibility) - { - case KACalendar::Incompatible: - emit notWritable(this); // allow an error message to be= output - return; - case KACalendar::Convertible: - if (mReconfiguring <=3D 2) - { - if (!isOpen()) - return; - load(NoSyncCache); // give user the option of conver= ting it - } - if (mCompatibility !=3D KACalendar::Current) - return; // not converted, so keep as read-only - break; - case KACalendar::Current: - case KACalendar::ByEvent: - case KACalendar::Converted: // shouldn't ever happen - break; - } - } - if (ronly !=3D oldRCronly) - ResourceCached::setReadOnly(ronly); - if ((ronly || (mCompatibility !=3D KACalendar::Current && mCompatibili= ty !=3D KACalendar::ByEvent)) !=3D oldronly) - emit readOnlyChanged(this); // the effective read-only status ha= s changed -} - -void AlarmResource::setEnabled(bool enable) -{ - if (mWrongAlarmType) - enable =3D false; - if (isActive() !=3D enable) - { - setActive(enable); - enableResource(enable); - emit enabledChanged(this); - } -} - -void AlarmResource::setColour(const QColor& colour) -{ - if (colour !=3D mColour) - { - mColour =3D colour; - emit colourChanged(this); - } -} - -bool AlarmResource::saveAndClose(CacheAction action, Incidence* incidence) -{ - bool result =3D save(action, incidence); - if (isSaving()) - mCloseAfterSave =3D true; // ensure it's closed if saving is asy= nchronous - else - close(); - return result; -} - -void AlarmResource::doClose() -{ - mCloseAfterSave =3D false; - emit invalidate(this); - KCal::ResourceCached::doClose(); - mLoaded =3D mLoading =3D false; - mCompatibilityMap.clear(); -} - -QString AlarmResource::infoText() const -{ - KRES::Factory* factory =3D KRES::Factory::self("alarms"); - QString atype; - switch (mType) - { - case CalEvent::ACTIVE: atype =3D i18nc("@info/plain", "Active a= larms"); break; - case CalEvent::ARCHIVED: atype =3D i18nc("@info/plain", "Archived= alarms"); break; - case CalEvent::TEMPLATE: atype =3D i18nc("@info/plain", "Alarm te= mplates"); break; - default: break; - } - QString perms =3D readOnly() ? i18nc("@info/plain", "Read-only") : i18= nc("@info/plain", "Read-write"); - QString enabled =3D isEnabled() ? i18nc("@info/plain", "Enabled") : mW= rongAlarmType ? i18nc("@info/plain", "Disabled (wrong alarm type)") : i18nc= ("@info/plain", "Disabled"); - QString std =3D (AlarmResources::instance()->getStandardResource(mType= ) =3D=3D this) ? i18nc("@info/plain Parameter in 'Default calendar: Yes/No'= ", "Yes") : i18nc("@info/plain Parameter in 'Default calendar: Yes/No'", "N= o"); - return i18nc("@info", - "%1" - "Calendar type: %2" - "Contents: %3" - "%4: %5" - "Permissions: %6" - "Status: %7" - "Default calendar: %8", - resourceName(), factory->typeName(type()), atype, displayType(), d= isplayLocation(), perms, enabled, std); -} - -void AlarmResource::lock(const QString& path) -{ - delete mLock; - if (path.isNull()) - mLock =3D 0; - else if (path.isEmpty()) - mLock =3D new KABC::LockNull(true); - else - mLock =3D new KABC::Lock(path); -} - -/*************************************************************************= ***** -* Check whether the alarm types in a calendar correspond with the resource= 's -* alarm type. -* Reply =3D true if at least 1 alarm is the right type. -*/ -bool AlarmResource::checkAlarmTypes(KCal::CalendarLocal& calendar) const -{ - if (mType !=3D CalEvent::EMPTY) - { - bool have =3D false; - bool other =3D false; - const Event::List events =3D calendar.rawEvents(); - for (int i =3D 0, iend =3D events.count(); i < iend; ++i) - { - CalEvent::Type s =3D CalEvent::status(events[i]); - if (mType =3D=3D s) - have =3D true; - else - other =3D true; - if (have && other) - break; - } - if (!have && other) - return false; // contains only wrong alarm types - } - return true; -} - -/* -void AlarmResource::kaCheckCalendar(CalendarLocal& cal) -{ - mTypes =3D CalEvent::EMPTY; - Event::List events =3D cal.rawEvents(); - for (int i =3D 0, iend =3D events.count(); i < iend; ++i) - { - switch (CalEvent::status(events[i])) - { - case CalEvent::ACTIVE: mTypes =3D static_cast(mTypes | CalEvent::ACTIVE); break; - case CalEvent::ARCHIVED: mTypes =3D static_cast(mTypes | CalEvent::ARCHIVED); break; - case CalEvent::TEMPLATE: mTypes =3D static_cast(mTypes | CalEvent::TEMPLATE); break; - default: break; - } - if (mTypes =3D=3D CalEvent::ALL) - break; - } -} -*/ - -#ifndef NDEBUG -QByteArray AlarmResource::typeName() const -{ - switch (mType) - { - case CalEvent::ACTIVE: return "Active"; - case CalEvent::ARCHIVED: return "Archived"; - case CalEvent::TEMPLATE: return "Template"; - default: return "Empty"; - } -} -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resources/alarmresource.h b/kalarm/resources/alarmresou= rce.h deleted file mode 100644 index e44462f..0000000 --- a/kalarm/resources/alarmresource.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * alarmresource.h - base class for a KAlarm alarm calendar resource - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef ALARMRESOURCE_H -#define ALARMRESOURCE_H - -/* @file alarmresource.h - base class for a KAlarm alarm calendar resource= */ - -#include "kalarm_resources_export.h" - -#include - -#include -#include -#include - -#include - -using KCal::CalendarLocal; -using namespace KAlarmCal; - - -#define KARES_DEBUG AlarmResource::debugArea() - - -/** Base class for a KAlarm alarm calendar resource. */ -class KALARM_RESOURCES_EXPORT AlarmResource : public KCal::ResourceCached -{ - Q_OBJECT - public: - /** Whether the fix function should convert old format KAlarm cale= ndars. */ - enum FixFunc { PROMPT, PROMPT_PART, CONVERT, NO_CONVERT }; - - AlarmResource(); - explicit AlarmResource(const KConfigGroup&); - explicit AlarmResource(CalEvent::Type); - ~AlarmResource(); - virtual void writeConfig(KConfigGroup&); - virtual QString infoText() const; - KABC::Lock* lock() { return mLock; } - - /** Return which type of alarms the resource can contain. */ - CalEvent::Type alarmType() const { return mType; } - - /** Set the type of alarms which the resource can contain. */ - void setAlarmType(CalEvent::Type type) { mType =3D type; } - - /** Return whether the resource contains only alarms of the wrong = type. */ - bool isWrongAlarmType() const { return mWrongAlarmType;= } - - /** Check whether the alarm types in a calendar correspond with - * the resource's alarm type. - * Reply =3D true if at least 1 alarm is the right type. - */ - bool checkAlarmTypes(KCal::CalendarLocal&) const; - - /** Set whether the application has a GUI. This determines whether= error or - * progress messages are displayed. */ - static void setNoGui(bool noGui) { mNoGui =3D noGui; } - static bool hasGui() { return !mNoGui; } - - /** Return the location(s) of the resource (URL, file path, etc.) = */ - virtual QStringList location() const =3D 0; - - /** Return the type of the resource (URL, file, etc.) - * for display purposes. */ - virtual QString displayType() const =3D 0; - - /** Return the location of the resource (URL, file path, etc.) - * for display purposes. */ - virtual QString displayLocation() const =3D 0; - - /** Change the resource's location. The resource will be reloaded = if active. */ - virtual bool setLocation(const QString& locn, const QString& locn2= =3D QString()) =3D 0; - /** Return whether the resource is the standard resource for its a= larm type. */ - bool standardResource() const { return mStandard; } - - /** Set or clear the resource as the standard resource for its ala= rm type. */ - void setStandardResource(bool std) { mStandard =3D std; } - - void setEnabled(bool enable); - bool isEnabled() const { return !mWrongAlarmType= && isActive(); } - - /** Return whether the resource can be written to now, - * i.e. it's active, read-write and in the current KAlarm format.= */ - bool writable() const { return isEnabled() && != readOnly(); } - - /** Return whether the event can be written to now, i.e. the resou= rce is - * active and read-write, and the event is in the current KAlarm = format. */ - bool writable(const KCal::Event*) const; - - /** Return whether the resource is cached, i.e. whether it is down= loaded - * and stored locally in a cache file. */ - virtual bool cached() const { return false; } - - /** Return whether the resource is read-only, either because it's = marked as - * read-only, or because it's active but not in the current KAlar= m format. */ - virtual bool readOnly() const; - virtual void setReadOnly(bool); - - /** Return the colour used to display alarms belonging to this res= ource. - * @return display colour, or invalid if none specified */ - QColor colour() const { return mColour; } - - /** Set the colour used to display alarms belonging to this resour= ce. - * @param color display colour, or invalid to use the default col= our */ - void setColour(const QColor& color); - /** Start a batch of configuration changes. - * The changes will be stored up until applyReconfig() is called.= */ - virtual void startReconfig(); - - /** Apply the batch of configuration changes since startReconfig()= was called. */ - virtual void applyReconfig(); - - /** Load the resource. - * If it's a cached resource, load() uses the default action to e= ither refresh - * the cache file first or not. - * If loading succeeds, the loaded() signal is emitted on complet= ion (but is - * not emitted if false is returned). This allows AlarmResources = to process - * the load. - * Loading is not performed if the resource is disabled. - * @return true if loading succeeded at least partially, false if= it failed - * completely - */ - bool load(CacheAction a) { return KCal::ResourceCached::load(a); } - - /** Return whether the resource has fully loaded. */ - bool isLoaded() const { return mLoaded; } - - /** Return whether the resource is in the process of loading. */ - bool isLoading() const { return mLoading; } - - /** Save the resource and then close it. - * It will be closed even if saving fails. */ - bool saveAndClose(CacheAction, KCal::Incidence* =3D 0); - bool saveAndClose(KCal::Incidence* incidence =3D 0) { return save= AndClose(DefaultCache, incidence); } - - /** Set a function to write the application ID into a calendar. */ - static void setCalIDFunction(void (*f)(CalendarLocal&)) { mCalI= DFunction =3D f; } - /** Set a function to create KAlarm event instances. - * When the function is called, the CalendarLocal parameter is - * set to null to indicate that the resource is about to be reloa= ded. */ - static void setCustomEventFunction(void (*f)(AlarmResource*, Calen= darLocal*)) { mCustomEventFunction =3D f; } - /** Set a function to fix the calendar once it has been loaded. */ - static void setFixFunction(KACalendar::Compat (*f)(CalendarLocal&,= const QString&, AlarmResource*, FixFunc, bool* wrongType)) - { mFixFunction =3D f; } - /** Return whether the resource is in a different format from the - * current KAlarm format, in which case it cannot be written to. - * Note that readOnly() takes account of both incompatible() and - * KCal::ResourceCached::readOnly(). - */ - KACalendar::Compat compatibility() const { return mCompatibility;= } - KACalendar::Compat compatibility(const KCal::Event*) const; - - virtual void showProgress(bool) {} - - static int debugArea() { return mDebugArea; } - static void setDebugArea(int area) { mDebugArea =3D area; } - -#ifndef NDEBUG - QByteArray typeName() const; -#endif - - public slots: - virtual void cancelDownload(bool /*disable*/ =3D false) {} - - signals: - /** Signal that the resource is about to close or reload. - * This signal warns that all events are about to be deleted. */ - void invalidate(AlarmResource*); - /** Signal that loading of the resource has completed, whether - * successfully or not. - * This signal is always emitted after a resource is loaded. */ - void loaded(AlarmResource*); - /** Emitted after attempting to save the resource, whether success= fully or not. - * Not emitted if no attempt was made to save it (e.g. if the res= ource - * is closed or read-only or there is nothing to save, or if save= () - * returned false). - */ - void resourceSaved(AlarmResource*); - /** Emitted during download for remote resources. */ - void downloading(AlarmResource*, unsigned long percent); - /** Signal that a remote resource download has completed, and the = cache file has been updated. */ - void cacheDownloaded(AlarmResource*); - /** Signal that the resource's read-only status has changed. */ - void readOnlyChanged(AlarmResource*); - /** Signal that the resource's wrong alarm type status has changed= . */ - void wrongAlarmTypeChanged(AlarmResource*); - /** Signal that the resource's active status has changed. */ - void enabledChanged(AlarmResource*); - /** Signal that the resource's location has changed. */ - void locationChanged(AlarmResource*); - /** Signal that the resource cannot be set read-write since its fo= rmat is incompatible. */ - void notWritable(AlarmResource*); - /** Signal that the display colour has changed. */ - void colourChanged(AlarmResource*); - - protected: - virtual void doClose(); - bool closeAfterSave() const { return mCloseAfterSa= ve; } - void setCompatibility(KACalendar::Compat c) { mCom= patibility =3D c; } - void checkCompatibility(const QString&); - KACalendar::Compat checkCompatibility(KCal::CalendarLocal&, const = QString& filename, FixFunc, bool* wrongType =3D 0); - void setWrongAlarmType(bool wrongType, bool emitSigna= l =3D true); - void updateCustomEvents(bool useCalendar =3D true); - virtual void enableResource(bool enable) =3D 0; - void lock(const QString& path); - - static void (*mCalIDFunction)(CalendarLocal&); - static KACalendar::Compat (*mFixFunction)(CalendarLocal&, const QS= tring&, AlarmResource*, FixFunc, bool* wrongType); - - private: - void init(); - - static int mDebugArea; // area for kDebug() output - static bool mNoGui; // application has no GUI, so don't = display messages - static void (*mCustomEventFunction)(AlarmResource*, C= alendarLocal*); - - KABC::Lock* mLock; - CalEvent::Type mType; // type of alarm held in this resource - QColor mColour; // background colour for displaying = this resource - bool mStandard; // this is the standard resource for= this mWriteType - bool mNewReadOnly; // new read-only status (while mReco= nfiguring =3D 1) - bool mOldReadOnly; // old read-only status (when startR= econfig() called) - bool mCloseAfterSave; // resource is to be closed once sav= e() is complete - bool mWrongAlarmType; // calendar contains only alarms of = the wrong type - KACalendar::Compat mCompatibility; // whether resource is in compa= tible format - - protected: - typedef QMap Compatibilit= yMap; - CompatibilityMap mCompatibilityMap; // whether individual event= s are in compatible format - short mReconfiguring; // a batch of config changes is in p= rogress - bool mLoaded; // true if resource has finished loa= ding - bool mLoading; // true if resource is currently loa= ding - - private: - using KCal::ResourceCached::load; // prevent "hidden" warning -}; - -typedef KRES::Manager AlarmResourceManager; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resources/alarmresources.cpp b/kalarm/resources/alarmre= sources.cpp deleted file mode 100644 index a38c041..0000000 --- a/kalarm/resources/alarmresources.cpp +++ /dev/null @@ -1,828 +0,0 @@ -/* - * alarmresources.cpp - alarm calendar resources - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "alarmresource.h" -#include "resourcelocal.h" -#include "resourceremote.h" -#include "alarmresources.moc" - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace KCal; -using namespace KAlarmCal; - -AlarmResources* AlarmResources::mInstance =3D 0; -QString AlarmResources::mReservedFile; -QString AlarmResources::mConstructionError; - -AlarmResources* AlarmResources::create(const KDateTime::Spec& timeSpec, bo= ol activeOnly, bool passiveClient) -{ - if (!mInstance) - { - AlarmResources* cal =3D new AlarmResources(timeSpec, activeOnly, p= assiveClient); - if (!mConstructionError.isEmpty()) - delete cal; - else - mInstance =3D cal; - } - return mInstance; -} - -AlarmResources::AlarmResources(const KDateTime::Spec& timeSpec, bool activ= eOnly, bool passiveClient) - : Calendar(timeSpec), - mActiveOnly(activeOnly), - mPassiveClient(passiveClient), - mNoGui(false), - mAskDestination(false), - mShowProgress(false), - mOpen(false), - mClosing(false) -{ - mManager =3D new AlarmResourceManager(QString::fromLatin1("alarms")); - mManager->addObserver(this); - mAskDestination =3D true; // prompt the user for a resource every t= ime an alarm is saved - - mManager->readConfig(0); - for (AlarmResourceManager::Iterator it =3D mManager->begin(); it !=3D= mManager->end(); ++it) - { - if (!mActiveOnly || (*it)->alarmType() =3D=3D CalEvent::ACTIVE) - connectResource(*it); - } - - if (!mPassiveClient && mManager->isEmpty()) - { - KConfigGroup config(KGlobal::config(), "General"); - AlarmResource* resource; - resource =3D addDefaultResource(config, CalEvent::ACTIVE); - setStandardResource(resource); - if (!mActiveOnly) - { - resource =3D addDefaultResource(config, CalEvent::ARCHIVED); - setStandardResource(resource); - resource =3D addDefaultResource(config, CalEvent::TEMPLATE); - setStandardResource(resource); - } - -#ifndef NDEBUG - kDebug(KARES_DEBUG) << "AlarmResources used:"; - for (AlarmResourceManager::Iterator it =3D mManager->begin(); it = !=3D mManager->end(); ++it) - kDebug(KARES_DEBUG) << (*it)->resourceName(); -#endif - } -} - -AlarmResources::~AlarmResources() -{ - kDebug(KARES_DEBUG); - close(); - delete mManager; - mManager =3D 0; - mInstance =3D 0; -} - -void AlarmResources::setNoGui(bool noGui) -{ - mNoGui =3D noGui; - if (mNoGui) - mShowProgress =3D false; - AlarmResource::setNoGui(mNoGui); -} - -AlarmResource* AlarmResources::addDefaultResource(CalEvent::Type type) -{ - KConfigGroup config(KGlobal::config(), "General"); - return addDefaultResource(config, type); -} - -AlarmResource* AlarmResources::addDefaultResource(const KConfigGroup& conf= ig, CalEvent::Type type) -{ - QString configKey, defaultFile, title; - switch (type) - { - case CalEvent::ACTIVE: - configKey =3D QString::fromLatin1("Calendar"); - defaultFile =3D QString::fromLatin1("calendar.ics"); - title =3D i18nc("@info/plain", "Active Alarms"); - break; - case CalEvent::TEMPLATE: - configKey =3D QString::fromLatin1("TemplateCalendar"); - defaultFile =3D QString::fromLatin1("template.ics"); - title =3D i18nc("@info/plain", "Alarm Templates"); - break; - case CalEvent::ARCHIVED: - configKey =3D QString::fromLatin1("ExpiredCalendar"); - defaultFile =3D QString::fromLatin1("expired.ics"); - title =3D i18nc("@info/plain", "Archived Alarms"); - break; - default: - return 0; - } - AlarmResource* resource =3D 0; - QString fileName =3D config.readPathEntry(configKey, QString()); - if (!fileName.isEmpty()) - { - // Calendar is specified in KAlarm config file - KUrl url(fileName); - if (!url.isValid()) - { - kError(KARES_DEBUG) << configKey << ": invalid name:" << fileN= ame; - mConstructionError =3D i18nc("@info", "%1: invalid calendar fi= le name: %2", configKey, fileName); - return 0; - } - if (!url.isLocalFile()) - resource =3D new KAResourceRemote(type, url); - else if (fileName =3D=3D mReservedFile) - { - kError(KARES_DEBUG) << configKey << ": name not allowed:" << f= ileName; - mConstructionError =3D i18nc("@info", "%1: file name not permi= tted: %2", configKey, fileName); - return 0; - } - else - resource =3D new KAResourceLocal(type, url.toLocalFile()); - } - if (!resource) - { - // No calendar is specified in config file, or the calendar - // specified is invalid - use default file - fileName =3D KStandardDirs::locateLocal("appdata", defaultFile); - resource =3D new KAResourceLocal(type, fileName); - } - - resource->setTimeSpec(timeSpec()); - resource->setResourceName(title); - resourceManager()->add(resource); - connectResource(resource); - return resource; -} - -AlarmResources::Result AlarmResources::addEvent(Event* event, CalEvent::Ty= pe type, QWidget* promptParent, bool noPrompt) -{ - kDebug(KARES_DEBUG) << event->uid(); - bool cancelled; - AlarmResource* resource =3D destination(type, promptParent, noPrompt, = &cancelled); - if (!resource) - { - delete event; - if (cancelled) - return Cancelled; - kDebug(KARES_DEBUG) << "No resource"; - return Failed; - } - if (!addEvent(event, resource)) - { - kDebug(KARES_DEBUG) << "Failed"; - return Failed; // event was deleted by addEvent() - } - return Success; -} - -AlarmResource* AlarmResources::getStandardResource(CalEvent::Type type) -{ - switch (type) - { - case CalEvent::ACTIVE: - { - AlarmResource* std =3D mManager->standardResource(); - if (std && std->standardResource() && std->alarmType() =3D= =3D CalEvent::ACTIVE && !std->readOnly()) - return std; - break; - } - case CalEvent::ARCHIVED: - case CalEvent::TEMPLATE: - if (mActiveOnly) - return 0; - for (AlarmResourceManager::ActiveIterator it =3D mManager->act= iveBegin(); it !=3D mManager->activeEnd(); ++it) - { - AlarmResource* r =3D *it; - if (r->alarmType() =3D=3D type && r->standardResource()) - return r; - } - break; - default: - return 0; - } - - // There's no nominated default alarm resource of the right type. - // If there's only one read/write alarm resource, use it. - AlarmResource* std =3D 0; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - { - AlarmResource* r =3D *it; - if (!r->readOnly() && r->alarmType() =3D=3D type) - { - if (std) - return 0; // there's more than one candidate - std =3D r; - } - } - if (std && type =3D=3D CalEvent::ACTIVE && !mPassiveClient) - setStandardResource(std); // mark it as the standard resource - return std; -} - -void AlarmResources::setStandardResource(AlarmResource* resource) -{ - if (resource->standardResource()) - return; // it's already the standard resource for its alarm type - CalEvent::Type type =3D resource->alarmType(); - bool active =3D (type =3D=3D CalEvent::ACTIVE); - for (AlarmResourceManager::Iterator it =3D mManager->begin(); it !=3D= mManager->end(); ++it) - { - AlarmResource* r =3D *it; - if (r->alarmType() =3D=3D type && r->standardResource()) - { - r->setStandardResource(false); - if (!active && !mPassiveClient) - mManager->change(r); // save resource's new configuration - } - } - resource->setStandardResource(true); - if (active) - { - mManager->setStandardResource(resource); - if (!mPassiveClient) - mManager->writeConfig(); - } - else if (!mPassiveClient) - mManager->change(resource); // save resource's new configuration - emit standardResourceChange(type); -} - -void AlarmResources::writeConfig() -{ - if (!mPassiveClient) - mManager->writeConfig(); -} - -int AlarmResources::activeCount(CalEvent::Type type, bool writable) -{ - int count =3D 0; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - { - AlarmResource* resource =3D *it; - if (resource->alarmType() =3D=3D type - && (!writable || !resource->readOnly())) - ++count; - } - return count; -} - -AlarmResource* AlarmResources::destination(Incidence* incidence, QWidget* = promptParent, bool* cancelled) -{ - Event* event =3D dynamic_cast(incidence); - CalEvent::Type type =3D event ? CalEvent::status(event) : CalEvent::AC= TIVE; - return destination(type, promptParent, false, cancelled); -} - -AlarmResource* AlarmResources::destination(CalEvent::Type type, QWidget* p= romptParent, bool noPrompt, bool* cancelled) -{ - if (cancelled) - *cancelled =3D false; - AlarmResource* standard; - switch (type) - { - case CalEvent::ACTIVE: - break; - case CalEvent::TEMPLATE: - if (mActiveOnly) - return 0; - break; - case CalEvent::ARCHIVED: - if (mActiveOnly) - return 0; - // Archived alarms are always saved in the default resource - return getStandardResource(CalEvent::ARCHIVED); - default: - return 0; - } - standard =3D getStandardResource(type); - if (noPrompt || (!mAskDestination && standard)) - return standard; - QList list; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - { - AlarmResource* resource =3D *it; - if (!resource->readOnly() && resource->alarmType() =3D=3D type) - { - // Insert the standard resource at the beginning so as to be t= he default - if (resource =3D=3D standard) - list.insert(0, resource); - else - list.append(resource); - } - } - switch (list.count()) - { - case 0: - return 0; - case 1: -// return static_cast(list.first()); - default: - { - KRES::Resource* r =3D KRES::SelectDialog::getResource(list, pr= omptParent); - if (!r && cancelled) - *cancelled =3D true; - return static_cast(r); - } - } -} - -int AlarmResources::loadedState(CalEvent::Type type) const -{ - if (!mOpen) - return 0; - bool loaded =3D false; - bool notloaded =3D false; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - { - AlarmResource* res =3D *it; - if (res->alarmType() =3D=3D type) - { - if (res->isLoaded()) - { - if (notloaded) - return 1; // some loaded, some not loaded - loaded =3D true; - } - else - { - if (loaded) - return 1; // some loaded, some not loaded - notloaded =3D true; - } - } - } - return !loaded ? 0 : notloaded ? 1 : 2; -} - -bool AlarmResources::isLoading(CalEvent::Type type) const -{ - if (mOpen) - { - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeB= egin(); it !=3D mManager->activeEnd(); ++it) - { - AlarmResource* res =3D *it; - if (res->alarmType() =3D=3D type && res->isLoading()) - return true; - } - } - return false; -} - -void AlarmResources::load(ResourceCached::CacheAction action) -{ - kDebug(KARES_DEBUG); - if (!mManager->standardResource()) - kDebug(KARES_DEBUG) << "Warning! No standard resource yet."; - - // Set the timezone for all resources. Otherwise we'll have those terr= ible tz troubles ;-(( - // Open all active resources - QList failed; - for (AlarmResourceManager::Iterator it =3D mManager->begin(); it !=3D= mManager->end(); ++it) - { - AlarmResource* resource =3D *it; - if (!mActiveOnly || resource->alarmType() =3D=3D CalEvent::ACTIV= E) - { - resource->setTimeSpec(timeSpec()); - if (resource->isActive()) - { - if (!load(resource, action)) - failed.append(resource); - } - } - } - for (int i =3D 0, end =3D failed.count(); i < end; ++i) - { - failed[i]->setActive(false); - emit signalResourceModified(failed[i]); - } - - // Ensure that if there is only one active alarm resource, - // it is marked as the standard resource. - getStandardResource(CalEvent::ACTIVE); - - mOpen =3D true; -} - -bool AlarmResources::load(AlarmResource* resource, ResourceCached::CacheAc= tion action) -{ - switch (action) - { - case ResourceCached::SyncCache: - case ResourceCached::NoSyncCache: - break; - default: - action =3D ResourceCached::SyncCache; - break; - } - return resource->load(action); -} - -// Called whenever a remote resource download has completed. -void AlarmResources::slotCacheDownloaded(AlarmResource* resource) -{ - if (resource->isActive()) - emit cacheDownloaded(resource); -} - -void AlarmResources::remap(AlarmResource* resource) -{ - for (ResourceMap::Iterator it =3D mResourceMap.begin(); it !=3D mReso= urceMap.end(); ) - { - if (it.value() =3D=3D resource) - it =3D mResourceMap.erase(it); - else - ++it; - } - Event::List events =3D resource->rawEvents(); - for (int i =3D 0, end =3D events.count(); i < end; ++i) - mResourceMap[events[i]] =3D resource; -} - -bool AlarmResources::reload() -{ - save(); - close(); - load(); - return true; -} - -void AlarmResources::close() -{ - if (mOpen && !mClosing) - { - kDebug(KARES_DEBUG); - mClosing =3D true; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeB= egin(); it !=3D mManager->activeEnd(); ++it) - (*it)->close(); - setModified(false); - mOpen =3D false; - mClosing =3D false; - } -} - -bool AlarmResources::save() -{ - kDebug(KARES_DEBUG); - if (!mOpen) - return false; - bool saved =3D false; - if (isModified()) - { - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeB= egin(); it !=3D mManager->activeEnd(); ++it) - { - if ((!mActiveOnly || (*it)->alarmType() =3D=3D CalEvent::ACT= IVE) - && (*it)->hasChanges()) - { - kDebug(KARES_DEBUG) << "Saving modified resource" << (*it)= ->identifier(); - (*it)->save(); - saved =3D true; - } - } - setModified(false); - } - if (!saved) - kDebug(KARES_DEBUG) << "No modified resources to save"; - return true; -} - -bool AlarmResources::isSaving() -{ - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - { - if ((*it)->isSaving()) - return true; - } - return false; -} - -void AlarmResources::showProgress(bool show) -{ - if (show !=3D mShowProgress) - { - mShowProgress =3D show; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeB= egin(); it !=3D mManager->activeEnd(); ++it) - (*it)->showProgress(show); - } -} - -bool AlarmResources::addEvent(Event* event, AlarmResource* resource) -{ - bool validRes =3D false; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - { - if ((*it) =3D=3D resource) - validRes =3D true; - } - AlarmResource* oldResource =3D mResourceMap.contains(event) ? mResourc= eMap[event] : 0; - mResourceMap[event] =3D resource; - if (validRes && resource->addIncidence(event)) - { - event->registerObserver(this); - notifyIncidenceAdded(event); - setModified(true); - return true; - } - if (oldResource) - mResourceMap[event] =3D oldResource; - else - mResourceMap.remove(event); - delete event; - return false; -} - -AlarmResources::Result AlarmResources::addEvent(Event* event, QWidget* pro= mptParent) -{ - kDebug(KARES_DEBUG) << this; - bool cancelled; - AlarmResource* resource =3D destination(event, promptParent, &cancelle= d); - if (resource) - { - mResourceMap[event] =3D resource; - if (resource->addIncidence(event)) - { - event->registerObserver(this); - notifyIncidenceAdded(event); - mResourceMap[event] =3D resource; - setModified(true); - return Success; - } - mResourceMap.remove(event); - } - else if (cancelled) - return Cancelled; - else - kDebug(KARES_DEBUG) << "No resource"; - return Failed; -} - -bool AlarmResources::deleteEvent(Event *event) -{ - kDebug(KARES_DEBUG) << event->uid(); - bool status =3D false; - ResourceMap::Iterator rit =3D mResourceMap.find(event); - if (rit !=3D mResourceMap.end()) - { - status =3D rit.value()->deleteEvent(event); - if (status) - mResourceMap.erase(rit); - } - else - { - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeB= egin(); it !=3D mManager->activeEnd(); ++it) - status =3D (*it)->deleteEvent(event) || status; - } - setModified(status); - return status; -} - -Event* AlarmResources::event(const QString& uid) -{ - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - { - Event* event =3D (*it)->event(uid); - if (event) - { - mResourceMap[event] =3D *it; - return event; - } - } - return 0; -} - -Alarm::List AlarmResources::alarmsTo(const KDateTime &to) -{ - Alarm::List result; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - result +=3D (*it)->alarmsTo(to); - return result; -} - -Alarm::List AlarmResources::alarms(const KDateTime &from, const KDateTime = &to) -{ - Alarm::List result; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - result +=3D (*it)->alarms(from, to); - return result; -} - -Event::List AlarmResources::rawEventsForDate(const QDate &date, const KDat= eTime::Spec& timespec, EventSortField sortField, SortDirection sortDirectio= n) -{ - Event::List result; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - appendEvents(result, (*it)->rawEventsForDate(date, timespec), *it); - return sortEvents(&result, sortField, sortDirection); -} - -Event::List AlarmResources::rawEvents(const QDate& start, const QDate& end= , const KDateTime::Spec& timespec, bool inclusive) -{ - kDebug(KARES_DEBUG) << "(start,end,inclusive)"; - Event::List result; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - appendEvents(result, (*it)->rawEvents(start, end, timespec, inclus= ive), *it); - return result; -} - -Event::List AlarmResources::rawEventsForDate(const KDateTime& dt) -{ - kDebug(KARES_DEBUG) << "(dt)"; - Event::List result; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - appendEvents(result, (*it)->rawEventsForDate(dt), *it); - return result; -} - -Event::List AlarmResources::rawEvents(EventSortField sortField, SortDirect= ion sortDirection) -{ - kDebug(KARES_DEBUG); - Event::List result; - for (AlarmResourceManager::ActiveIterator it =3D mManager->activeBegin= (); it !=3D mManager->activeEnd(); ++it) - appendEvents(result, (*it)->rawEvents(EventSortUnsorted), *it); - return sortEvents(&result, sortField, sortDirection); -} - -Event::List AlarmResources::rawEvents(AlarmResource* resource, EventSortFi= eld sortField, SortDirection sortDirection) -{ - kDebug(KARES_DEBUG) << "(resource)"; - Event::List result; - if (!resource->isActive()) - return result; - appendEvents(result, resource->rawEvents(EventSortUnsorted), resource); - return sortEvents(&result, sortField, sortDirection); -} - -void AlarmResources::appendEvents(Event::List& result, const Event::List& = events, AlarmResource* resource) -{ - result +=3D events; - for (int i =3D 0, end =3D events.count(); i < end; ++i) - mResourceMap[events[i]] =3D resource; -} - -// Called whenever a resource is added to those managed by the AlarmResour= ces, -// to initialise it and connect its signals. -void AlarmResources::connectResource(AlarmResource* resource) -{ - kDebug(KARES_DEBUG) << resource->resourceName(); - resource->disconnect(this); // just in case we're called twice - connect(resource, SIGNAL(enabledChanged(AlarmResource*)), SLOT(slotAct= iveChanged(AlarmResource*))); - connect(resource, SIGNAL(readOnlyChanged(AlarmResource*)), SLOT(slotRe= adOnlyChanged(AlarmResource*))); - connect(resource, SIGNAL(wrongAlarmTypeChanged(AlarmResource*)), SLOT(= slotWrongTypeChanged(AlarmResource*))); - connect(resource, SIGNAL(locationChanged(AlarmResource*)), SLOT(slotLo= cationChanged(AlarmResource*))); - connect(resource, SIGNAL(colourChanged(AlarmResource*)), SLOT(slotColo= urChanged(AlarmResource*))); - connect(resource, SIGNAL(invalidate(AlarmResource*)), SLOT(slotResourc= eInvalidated(AlarmResource*))); - connect(resource, SIGNAL(loaded(AlarmResource*)), SLOT(slotResourceLoa= ded(AlarmResource*))); - connect(resource, SIGNAL(cacheDownloaded(AlarmResource*)), SLOT(slotCa= cheDownloaded(AlarmResource*))); -// connect(resource, SIGNAL(downloading(AlarmResource*,ulong)), -// SLOT(slotResourceDownloading(AlarmResource*,ulong)= )); - connect(resource, SIGNAL(resourceSaved(AlarmResource*)), SLOT(slotReso= urceSaved(AlarmResource*))); - connect(resource, SIGNAL(resourceChanged(ResourceCalendar*)), SLOT(slo= tResourceChanged(ResourceCalendar*))); - connect(resource, SIGNAL(resourceLoadError(ResourceCalendar*,QString)), - SLOT(slotLoadError(ResourceCalendar*,QString))); - connect(resource, SIGNAL(resourceSaveError(ResourceCalendar*,QString)), - SLOT(slotSaveError(ResourceCalendar*,QString))); -} - -void AlarmResources::slotResourceInvalidated(AlarmResource* resource) -{ - emit resourceStatusChanged(resource, Invalidated); -} - -void AlarmResources::slotResourceLoaded(AlarmResource* resource) -{ - remap(resource); - Incidence::List incidences =3D resource->rawIncidences(); - for (int i =3D 0, end =3D incidences.count(); i < end; ++i) - { - incidences[i]->registerObserver(this); - notifyIncidenceAdded(incidences[i]); - } - emit resourceLoaded(resource, resource->isActive()); -} - -void AlarmResources::slotResourceSaved(AlarmResource* resource) -{ - if (resource->isActive()) - emit resourceSaved(resource); -} - -/*void AlarmResources::slotResourceDownloading(AlarmResource* resource, un= signed long percent) -{ - if (resource->isActive()) - emit downloading(resource, percent); -}*/ - -void AlarmResources::slotResourceChanged(ResourceCalendar* resource) -{ - if (resource->isActive()) - emit calendarChanged(); -} - -void AlarmResources::slotLoadError(ResourceCalendar* resource, const QStri= ng& err) -{ - if (resource->isActive()) - emit signalErrorMessage(err); -} - -void AlarmResources::slotSaveError(ResourceCalendar* resource, const QStri= ng& err) -{ - if (resource->isActive()) - emit signalErrorMessage(err); -} - -void AlarmResources::slotResourceStatusChanged(AlarmResource* resource, Ch= ange change) -{ - kDebug(KARES_DEBUG) << resource->resourceName() << ", " << (change =3D= =3D Added ? "Added" : change =3D=3D Enabled ? "Enabled" : change =3D=3D Rea= dOnly ? "ReadOnly" : change =3D=3D WrongType ? "WrongType" : change =3D=3D = Location ? "Location" : "Colour"); - if (!resource->writable()) - { - // The resource is no longer writable, so it can't be a standard r= esource - // N.B. Setting manager's standard resource to 0 does nothing. - if (resource->standardResource()) - resource->setStandardResource(false); - } - if (!mPassiveClient) - mManager->change(resource); // save resource's new configuration - emit resourceStatusChanged(resource, change); - if (change =3D=3D Location && resource->isActive()) - load(resource); -} - -AlarmResource* AlarmResources::resourceWithId(const QString& resourceID) c= onst -{ - for (AlarmResourceManager::Iterator it =3D mManager->begin(); it !=3D= mManager->end(); ++it) - { - if ((*it)->identifier() =3D=3D resourceID) - return *it; - } - return 0; -} - -AlarmResource* AlarmResources::resourceForIncidence(const QString& inciden= ceID) -{ - return resource(incidence(incidenceID)); -} - -AlarmResource* AlarmResources::resource(const Incidence* incidence) const -{ - if (!incidence) - return 0; - ResourceMap::ConstIterator it =3D mResourceMap.find(const_cast(incidence)); - return (it !=3D mResourceMap.constEnd()) ? it.value() : 0; -} - -// Called by the resource manager when a resource is added to the collecti= on -void AlarmResources::resourceAdded(AlarmResource* resource) -{ - kDebug(KARES_DEBUG) << resource->resourceName(); - connectResource(resource); - if (resource->isActive()) - load(resource); - emit resourceStatusChanged(resource, Added); -} - -void AlarmResources::resourceDeleted(AlarmResource* resource) -{ - kDebug(KARES_DEBUG); - emit resourceStatusChanged(resource, Deleted); -} - -/*************************************************************************= ***** -* Set the time zone for all resources. -*/ -void AlarmResources::doSetTimeSpec(const KDateTime::Spec& timeSpec) -{ - AlarmResourceManager::Iterator i1; - for (i1 =3D mManager->begin(); i1 !=3D mManager->end(); ++i1) - (*i1)->setTimeSpec(timeSpec); -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/alarmresources.h b/kalarm/resources/alarmreso= urces.h deleted file mode 100644 index a760444..0000000 --- a/kalarm/resources/alarmresources.h +++ /dev/null @@ -1,475 +0,0 @@ -/* - * alarmresources.h - alarm calendar resources - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * Based on calendarresources.h in libkcal, - * Copyright (c) 2003 Cornelius Schumacher - * Copyright (C) 2003-2004 Reinhold Kainhofer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef ALARMRESOURCES_H -#define ALARMRESOURCES_H - -#include "alarmresource.h" -#include "kalarm_resources_export.h" - -#include - -#include -#include - -class KConfigGroup; -namespace KCal { class Event; } -using KCal::CalendarLocal; -using KCal::ResourceCalendar; -using namespace KAlarmCal; - - -/** Provides access to all alarm calendar resources. */ -class KALARM_RESOURCES_EXPORT AlarmResources : public KCal::Calendar, publ= ic KRES::ManagerObserver -{ - Q_OBJECT - public: - enum Change { Added, Deleted, Invalidated, Enabled, ReadOnly, Wron= gType, Location, Colour }; - // Return code when the user can cancel an operation - enum Result { Success, Cancelled, Failed }; - - class Ticket - { - friend class AlarmResources; - public: - AlarmResource* resource() const { return mResource; } - private: - explicit Ticket(AlarmResource* r) : mResource(r) { } - AlarmResource* mResource; - }; - - /** Create the alarm calendar resources instance. - * If the alarm calendar resources instance has already been crea= ted, - * the existing instance is returned regardless of parameters pas= sed. - * @return The alarm calendar resources instance, or 0 if a reser= ved - * file name was used (in which case, use creationError()= to - * fetch the error message). - */ - static AlarmResources* create(const KDateTime::Spec& timeSpec, boo= l activeOnly =3D false, bool passiveClient =3D false); - static QString creationError() { return mConstructionError; } - virtual ~AlarmResources(); - /** Return the alarm calendar resources instance. - * @return The alarm calendar resources instance, or 0 if not alr= eady created. - */ - static AlarmResources* instance() { return mInstance; } - /** Set a reserved local calendar file path which can't be used by= this class. */ - static void setReservedFile(const QString& path) { mReservedFi= le =3D path; } - - /** Set whether the application has a GUI. This determines whether= error or - * progress messages are displayed. */ - void setNoGui(bool); - - /** Specify that the client is passive, i.e. never makes changes t= o the - * resource configuration. This will prevent any configuration ch= anges - * from being saved. */ - void setPassiveClient(bool p) { mPassiveClient =3D p; } - bool passiveClient() { return mPassiveClient; } - - /** Return the standard resource for the given alarm type. - * @return 0 if no standard resource is set. - */ - AlarmResource* getStandardResource(CalEvent::Type); - /** Set the specified resource to be the standard resource for its= alarm type, - * replacing any existing standard resource. - */ - void setStandardResource(AlarmResource*); - - /** Add the standard KAlarm default resource for the given alarm t= ype. */ - AlarmResource* addDefaultResource(CalEvent::Type); - - /** Return the number of active resources for a given alarm type. = */ - int activeCount(CalEvent::Type, bool writable); - - void writeConfig(); - /** Set a function to write the application ID into a calendar. */ - void setCalIDFunction(void (*f)(CalendarLocal&)) - { AlarmResource::setCalIDFunction(f)= ; } - /** Set a function to create KAlarm event instances. - * When the function is called, the CalendarLocal parameter is - * set to null to indicate that the resource is about to be reloa= ded. */ - void setCustomEventFunction(void (*f)(AlarmResource*, CalendarLoca= l*)) - { AlarmResource::setCustomEventFunct= ion(f); } - /** Set a function to fix the calendar once it has been loaded. */ - void setFixFunction(KACalendar::Compat (*f)(CalendarLocal&, const = QString&, AlarmResource*, AlarmResource::FixFunc, bool* wrongType)) - { AlarmResource::setFixFunction(f); } - - /** Add an event to the resource calendar. - * The resource calendar takes ownership of the event. - * @return Success if success; otherwise the event is deleted, and - * Cancelled or Failed is returned. - */ - Result addEvent(KCal::Event*, CalEvent::Type, QWidget* promptParen= t =3D 0, bool noPrompt =3D false); - - /** Return whether all, some or none of the active resources are l= oaded. - * @return 0 if no resources are loaded, - * 1 if some but not all active resources are loaded, - * 2 if all active resources are loaded. - */ - int loadedState(CalEvent::Type) const; - bool isLoading(CalEvent::Type) const; - void showProgress(bool); - - /** Loads all incidences from the resources. The resources must b= e added - * first using either readConfig(KConfig*), which adds the system - * resources, or manually using resourceAdded(AlarmResource*). - */ - void load(KCal::ResourceCached::CacheAction =3D KCal::ResourceCach= ed::DefaultCache); - bool load(AlarmResource*, KCal::ResourceCached::CacheAction =3D KC= al::ResourceCached::DefaultCache); - - /** - * Reloads all incidences from all resources. - * @return success or failure - */ - virtual bool reload(); - - /** - Clear out the current Calendar, freeing all used memory etc. - */ - virtual void close(); - - /** - Sync changes in memory to persistant storage. - */ - virtual bool save(); - - /** - Determine if the Calendar is currently being saved. - - @return true if the Calendar is currently being saved; false otherw= ise. - */ - virtual bool isSaving(); - - /** - Get the CalendarResourceManager used by this calendar. - - @return a pointer to the CalendarResourceManage. - */ - AlarmResourceManager* resourceManager() const { return mManager; } - - /** - Get the resource with the specified resource ID. - - @param resourceID the ID of the resource - @return pointer to the resource, or null if not found - */ - AlarmResource* resourceWithId(const QString& resourceID) const; - - /** - Get the resource associated with a specified incidence. - - @param incidence is a pointer to an incidence whose resource - is to be located. - @return a pointer to the resource containing the incidence. - */ - AlarmResource* resource(const KCal::Incidence*) const; - - /** - Get the resource associated with a specified incidence ID. - - @param incidenceID the ID of the incidence whose resource is to be = located. - @return a pointer to the resource containing the incidence. - */ - AlarmResource* resourceForIncidence(const QString& incidenceID); - - /** - Read the Resources settings from a config file. - - @param config The KConfig object which points to the config file. - If no object is given (null pointer) the standard config file is us= ed. - - @note Call this method before load(). - */ - void readConfig(KConfig* config =3D 0); - - /** - Set the destination policy such that Incidences are added to a - Resource which is queried. - @param ask if true, prompt for which resource to add to, if - false, add to standard resource. - */ - void setAskDestinationPolicy(bool ask) { mAskDestination =3D ask; } - - /** Find the resource to be used to store an event of a given type. - * @param cancelled If non-null: set to true if the user cancelled - * the prompt dialogue; set to false if any other erro= r. - */ - AlarmResource* destination(CalEvent::Type, QWidget* promptParent = =3D 0, bool noPrompt =3D false, bool* cancelled =3D 0); - - /** - Called when a resource is added to the managed collection. - Overrides KRES::ManagerObserver::resourceAdded(). - This method must be public, because in-process added resources - do not emit the corresponding signal, so this methodd has to be - called manually! - - @param resource is a pointer to the AlarmResource to add. - */ - virtual void resourceAdded(AlarmResource* resource); - -// Incidence Specific Methods // - - // Event Specific Methods // - - /** - Insert an Event into the Calendar. - - @param event is a pointer to the Event to insert. - @return true if the Event was successfully inserted; false othe= rwise. - */ - virtual bool addEvent(KCal::Event* event) { return addEvent(even= t, (QWidget*)0); } - /** @return Success if success; otherwise the event is deleted, and - * Cancelled or Failed is returned. - */ - Result addEvent(KCal::Event* event, QWidget* promptParent); - - /** - Insert an Event into a Calendar Resource. - - @param event is a pointer to the Event to insert. - @param resource is a pointer to the AlarmResource to be added t= o. - @return true if the Event was successfully inserted; false othe= rwise. - */ - bool addEvent(KCal::Event* event, AlarmResource* resource); - - /** - Remove an Event from the Calendar. - - @param event is a pointer to the Event to remove. - @return true if the Event was successfully removed; false other= wise. - - @note In most cases use deleteIncidence(Incidence*) instead. - */ - virtual bool deleteEvent(KCal::Event* event); - - /** - Removes all Events from the calendar. - */ - virtual void deleteAllEvents() {} - - /** - Return a sorted, unfiltered list of all Events. - - @param sortField specifies the EventSortField. - @param sortDirection specifies the SortDirection. - @return the list of all unfiltered Events sorted as specified. - */ - virtual KCal::Event::List rawEvents( - KCal::EventSortField sortField =3D KCal::EventSortUnsorted, - KCal::SortDirection sortDirection =3D KCal::SortDirectionAscendi= ng); - - /** - Return a sorted, unfiltered list of all Events for one resource. - Call this in preference to AlarmResource::rawEvents(), to ensure - that the overall events index is updated. - - @param resource the AlarmResource to retrieve events for - @param sortField specifies the EventSortField. - @param sortDirection specifies the SortDirection. - @return the list of all unfiltered Events sorted as specified. - */ - virtual KCal::Event::List rawEvents(AlarmResource* resource, - KCal::EventSortField sortField =3D KCal::EventSortUnsorted, - KCal::SortDirection sortDirection =3D KCal::SortDirectionAscendi= ng); - - /** - Return an unfiltered list of all Events which occur on the given - timestamp. - - @param dt request unfiltered Event list for this KDateTime only. - @return the list of unfiltered Events occurring on the specified - timestamp. - */ - virtual KCal::Event::List rawEventsForDate(const KDateTime& dt); - - /** - Return an unfiltered list of all Events occurring within a date= range. - - @param start is the starting date. - @param end is the ending date. - @param timespec the time spec to use to interpret @p start and = @p end - @param inclusive if true only Events which are completely inclu= ded - within the date range are returned. - @return the list of unfiltered Events occurring within the spec= ified - date range. - */ - virtual KCal::Event::List rawEvents(const QDate& start, const QDat= e& end, - const KDateTime::Spec& timespec =3D KDateTi= me::Spec(), - bool inclusive =3D false); - - /** - Return a sorted, unfiltered list of all Events which occur on t= he given - date. The Events are sorted according to @a sortField and - @a sortDirection. - - @param date request unfiltered Event list for this QDate only. - @param timespec the time spec to use to interpret @p date - @param sortField specifies the EventSortField. - @param sortDirection specifies the SortDirection. - @return the list of sorted, unfiltered Events occurring on @a d= ate. - */ - virtual KCal::Event::List rawEventsForDate( - const QDate& date, - const KDateTime::Spec& timespec =3D KDateTime::Spec(), - KCal::EventSortField sortField =3D KCal::EventSortUnsorted, - KCal::SortDirection sortDirection =3D KCal::SortDirectionAscendi= ng); - - /** - Returns the Event associated with the given unique identifier. - - @param uid is a unique identifier string. - @return a pointer to the Event. - A null pointer is returned if no such Event exists. - */ - virtual KCal::Event* event(const QString& uid); - - // Alarm Specific Methods // - - /** - Return a list of Alarms within a time range for this Calendar. - - @param from is the starting timestamp. - @param to is the ending timestamp. - @return the list of Alarms for the for the specified time range. - */ - virtual KCal::Alarm::List alarms(const KDateTime& from, const KDat= eTime& to); - - /** - Return a list of Alarms that occur before the specified timesta= mp. - - @param to is the ending timestamp. - @return the list of Alarms occurring before the specified KDate= Time. - */ - KCal::Alarm::List alarmsTo(const KDateTime& to); - - static void setDebugArea(int area) { AlarmResource::setDebugArea= (area); } - - using QObject::event; // prevent warning about hidden virtual me= thod - - signals: - /** Signal that the Resource has been modified. */ - void signalResourceModified(AlarmResource*); - - /** Signal an error message. */ - void signalErrorMessage(const QString& err); - - /** Signal that a different standard resource has been set for the= given alarm type. */ - void standardResourceChange(CalEvent::Type); - - void resourceSaved(AlarmResource*); - /** Signal that a remote resource's cache has completed downloadin= g. */ - void cacheDownloaded(AlarmResource*); - /** Signal that one resource has completed loading. */ - void resourceLoaded(AlarmResource*, bool success); - /** Emitted at start of download only if mShowProgress is true. */ - void downloading(AlarmResource*, unsigned long percent); - /** Signal that a resource has been added or deleted, or a resourc= e's - * enabled or read-only status has changed. */ - void resourceStatusChanged(AlarmResource*, AlarmResources::Change); - - protected: - virtual void connectResource(AlarmResource*); - virtual void resourceModified(AlarmResource*) {} - virtual void resourceDeleted(AlarmResource*); - - /** - Let CalendarResource subclasses set the time specification - (time zone, etc.) - */ - virtual void doSetTimeSpec(const KDateTime::Spec& timeSpec); - - /** - Increment the number of times this Resource has been changed. - - @param resource is a pointer to the AlarmResource to be counted. - @return the new number of times this Resource has been changed. - */ - int incrementChangeCount(AlarmResource* resource); - - /** - Decrement the number of times this Resource has been changed. - - @param resource is a pointer to the AlarmResource to be counted. - @return the new number of times this Resource has been changed. - */ - int decrementChangeCount(AlarmResource* resource); - - protected slots: - void slotLoadError(ResourceCalendar*, const QString& err); - void slotSaveError(ResourceCalendar*, const QString& err); - - private: - // Override unused virtual functions - virtual bool addTodo(KCal::Todo*) { return true; } - virtual bool deleteTodo(KCal::Todo*) { return true; } - virtual void deleteAllTodos() {} - virtual KCal::Todo::List rawTodos(KCal::TodoSortField =3D KCal::To= doSortUnsorted, KCal::SortDirection =3D KCal::SortDirectionAscending) { ret= urn KCal::Todo::List(); } - virtual KCal::Todo::List rawTodosForDate(const QDate&) { return KC= al::Todo::List(); } - virtual KCal::Todo* todo(const QString&) { return 0; } - virtual bool addJournal(KCal::Journal*) { return true; } - virtual bool deleteJournal(KCal::Journal*) { return true; } - virtual void deleteAllJournals() {} - virtual KCal::Journal::List rawJournals(KCal::JournalSortField =3D= KCal::JournalSortUnsorted, KCal::SortDirection =3D KCal::SortDirectionAsce= nding) { return KCal::Journal::List(); } - virtual KCal::Journal::List rawJournalsForDate(const QDate&) { ret= urn KCal::Journal::List(); } - virtual KCal::Journal* journal(const QString&) { return 0; } - - private slots: - void slotActiveChanged(AlarmResource* r) { slotResourceStatus= Changed(r, Enabled); } - void slotReadOnlyChanged(AlarmResource* r) { slotResourceStatus= Changed(r, ReadOnly); } - void slotWrongTypeChanged(AlarmResource* r) { slotResourceStatus= Changed(r, WrongType); } - void slotLocationChanged(AlarmResource* r) { slotResourceStatus= Changed(r, Location); } - void slotColourChanged(AlarmResource* r) { slotResourceStatus= Changed(r, Colour); } - void slotResourceLoaded(AlarmResource*); - void slotResourceSaved(AlarmResource*); - void slotCacheDownloaded(AlarmResource*); - void slotResourceChanged(ResourceCalendar*); - void slotResourceInvalidated(AlarmResource*); - - private: - AlarmResources(const KDateTime::Spec& timeSpec, bool activeOnly, b= ool passiveClient); - AlarmResource* addDefaultResource(const KConfigGroup&, CalEvent::T= ype); - AlarmResource* destination(KCal::Incidence*, QWidget* promptParent= , bool* cancelled =3D 0); - void appendEvents(KCal::Event::List& result, const KCal::Event::L= ist& events, AlarmResource*); - void slotResourceStatusChanged(AlarmResource*, Change); - void remap(AlarmResource*); - - static AlarmResources* mInstance; - static QString mReservedFile; // disallowed file pa= th - static QString mConstructionError; // error string if an= error occurred in creating instance - - KRES::Manager* mManager; - typedef QMap ResourceMap; - ResourceMap mResourceMap; - QMap mTickets; - QMap mChangeCounts; - bool mActiveOnly; // only resource calendars containin= g ACTIVE alarms are to be opened - bool mPassiveClient; // true if client never initiates ch= anges - bool mNoGui; // application has no GUI, so don't = display messages - bool mAskDestination; // true to prompt user which resourc= e to store new events in - bool mShowProgress; // emit download progress signals - bool mOpen; - bool mClosing; // close() is in progress -}; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resources/kalarm_manager.desktop b/kalarm/resources/kal= arm_manager.desktop deleted file mode 100644 index 6aaea1c..0000000 --- a/kalarm/resources/kalarm_manager.desktop +++ /dev/null @@ -1,60 +0,0 @@ -# KDE Config File -[Desktop Entry] -Name=3DAlarms -Name[ar]=3D=D8=A7=D9=84=D9=85=D9=86=D8=A8=D9=87=D8=A7=D8=AA -Name[bg]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 -Name[bs]=3DAlarmi -Name[ca]=3DAlarmes -Name[ca@valencia]=3DAlarmes -Name[cs]=3DAlarmy -Name[da]=3DAlarmer -Name[de]=3DErinnerungen -Name[el]=3D=CE=A3=CF=85=CE=BD=CE=B1=CE=B3=CE=B5=CF=81=CE=BC=CE=BF=CE=AF -Name[en_GB]=3DAlarms -Name[es]=3DAlarmas -Name[et]=3DH=C3=A4ired -Name[fi]=3DH=C3=A4lytykset -Name[fr]=3DAlarmes -Name[ga]=3DAl=C3=A1raim -Name[gl]=3DAlarmas -Name[hu]=3DEml=C3=A9keztet=C5=91k -Name[ia]=3DAlarmas -Name[it]=3DAvvisi -Name[ja]=3D=E3=82=A2=E3=83=A9=E3=83=BC=E3=83=A0 -Name[kk]=3D=D0=95=D1=81=D0=BA=D0=B5=D1=80=D1=82=D1=83=D0=BB=D0=B5=D1=80 -Name[km]=3D=E1=9E=87=E1=9E=BC=E1=9E=93=E2=80=8B=E1=9E=8A=E1=9F=86=E1=9E=8E= =E1=9E=B9=E1=9E=84 -Name[ko]=3D=EC=95=8C=EB=9E=8C -Name[lt]=3DPriminimai -Name[lv]=3DAtg=C4=81din=C4=81jumi -Name[mai]=3D=E0=A4=B8=E0=A4=9A=E0=A5=87=E0=A4=A4=E0=A4=95 -Name[mr]=3D=E0=A4=8F=E0=A4=B2=E0=A4=BE=E0=A4=B0=E0=A5=8D=E0=A4=AE=E0=A5=8D= =E0=A4=B8 -Name[nb]=3DVarslinger -Name[nds]=3DAlarms -Name[ne]=3D=E0=A4=B8=E0=A4=82=E0=A4=B8=E0=A5=82=E0=A4=9A=E0=A4=95 -Name[nl]=3DHerinneringen -Name[nn]=3DAlarmar -Name[oc]=3DAlarmas -Name[pa]=3D=E0=A8=85=E0=A8=B2=E0=A8=BE=E0=A8=B0=E0=A8=AE -Name[pl]=3DAlarmy -Name[pt]=3DAlarmes -Name[pt_BR]=3DAlarmes -Name[ro]=3DAlarme -Name[ru]=3D=D0=9D=D0=B0=D0=BF=D0=BE=D0=BC=D0=B8=D0=BD=D0=B0=D0=BD=D0=B8=D1= =8F -Name[sk]=3DAlarmy -Name[sl]=3DAlarmi -Name[sr]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 -Name[sr@ijekavian]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 -Name[sr@ijekavianlatin]=3DAlarmi -Name[sr@latin]=3DAlarmi -Name[sv]=3DAlarm -Name[th]=3D=E0=B9=81=E0=B8=88=E0=B9=89=E0=B8=87=E0=B9=80=E0=B8=95=E0=B8=B7= =E0=B8=AD=E0=B8=99 -Name[tr]=3DAlarmlar -Name[ug]=3D=D9=82=D9=88=DA=AD=D8=BA=DB=87=D8=B1=D8=A7=D9=82=D9=84=D8=A7=D8= =B1 -Name[uk]=3D=D0=9D=D0=B0=D0=B3=D0=B0=D0=B4=D1=83=D0=B2=D0=B0=D0=BD=D0=BD=D1= =8F -Name[wa]=3DXh=C3=AEletes -Name[x-test]=3DxxAlarmsxx -Name[zh_CN]=3D=E6=8F=90=E9=86=92=E4=BA=8B=E9=A1=B9 -Name[zh_TW]=3D=E9=AC=A7=E9=90=98 -Type=3DService -X-KDE-ServiceTypes=3DKResources/Manager -X-KDE-ResourceFamily=3Dalarms diff --git a/kalarm/resources/kalarm_resources_export.h b/kalarm/resources/= kalarm_resources_export.h deleted file mode 100644 index c848733..0000000 --- a/kalarm/resources/kalarm_resources_export.h +++ /dev/null @@ -1,43 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public Lice= nse - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KALARM_RESOURCES_EXPORT_H -#define KALARM_RESOURCES_EXPORT_H - -/* needed for KDE_EXPORT and KDE_IMPORT macros */ -#include - -#ifndef KALARM_RESOURCES_EXPORT -# if defined(KDEPIM_STATIC_LIBS) - /* No export/import for static libraries */ -# define KALARM_RESOURCES_EXPORT -# elif defined(MAKE_KALARM_RESOURCES_LIB) - /* We are building this library */ -# define KALARM_RESOURCES_EXPORT KDE_EXPORT -# else - /* We are using this library */ -# define KALARM_RESOURCES_EXPORT KDE_IMPORT -# endif -#endif - -# ifndef KALARM_RESOURCES_EXPORT_DEPRECATED -# define KALARM_RESOURCES_EXPORT_DEPRECATED KDE_DEPRECATED KALARM_RESOURC= ES_EXPORT -# endif - -#endif diff --git a/kalarm/resources/local.desktop b/kalarm/resources/local.desktop deleted file mode 100644 index 4d48719..0000000 --- a/kalarm/resources/local.desktop +++ /dev/null @@ -1,104 +0,0 @@ -[Desktop Entry] -Name=3DAlarms in Local File -Name[ar]=3D=D8=A7=D9=84=D8=AA=D9=86=D8=A8=D9=8A=D9=87=D8=A7=D8=AA =D9=81= =D9=8A =D8=A7=D9=84=D9=85=D9=84=D9=81 =D8=A7=D9=84=D9=85=D8=AD=D9=84=D9=8A -Name[bg]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 =D0=B2 =D0=BB=D0=BE=D0=BA= =D0=B0=D0=BB=D0=B5=D0=BD =D1=84=D0=B0=D0=B9=D0=BB -Name[bs]=3DAlarmi u lokalnoj datoteci -Name[ca]=3DAlarmes en un fitxer local -Name[ca@valencia]=3DAlarmes en un fitxer local -Name[cs]=3DKalend=C3=A1=C5=99 v m=C3=ADstn=C3=ADm souboru -Name[da]=3DAlarmer i lokal fil -Name[de]=3DErinnerungen in lokaler Datei -Name[el]=3D=CE=A3=CF=85=CE=BD=CE=B1=CE=B3=CE=B5=CF=81=CE=BC=CE=BF=CE=AF = =CF=83=CE=B5 =CF=84=CE=BF=CF=80=CE=B9=CE=BA=CF=8C =CE=B1=CF=81=CF=87=CE=B5= =CE=AF=CE=BF -Name[en_GB]=3DAlarms in Local File -Name[es]=3DAlarmas en un archivo local -Name[et]=3DH=C3=A4ired kohalikus failis -Name[fa]=3D=D9=87=D8=B4=D8=AF=D8=A7=D8=B1=D9=87=D8=A7 =D8=AF=D8=B1 =D9=BE= =D8=B1=D9=88=D9=86=D8=AF=D9=87 =D9=85=D8=AD=D9=84=DB=8C -Name[fi]=3DH=C3=A4lytykset paikallisessa tiedostossa -Name[fr]=3DAlarmes dans un fichier local -Name[ga]=3DAl=C3=A1raim i gComhad Log=C3=A1nta -Name[gl]=3DAlarmas nun ficheiro local -Name[hu]=3DHelyi f=C3=A1jlban t=C3=A1rolt eml=C3=A9keztet=C5=91k -Name[ia]=3DAlarmas in file local -Name[it]=3DAvvisi in file locale -Name[ja]=3D=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB=E3=83=95=E3=82=A1=E3=82=A4= =E3=83=AB=E3=81=AE=E3=82=A2=E3=83=A9=E3=83=BC=E3=83=A0 -Name[kk]=3D=D0=96=D0=B5=D1=80=D0=B3=D1=96=D0=BB=D1=96=D0=BA=D1=82=D1=96 = =D1=84=D0=B0=D0=B9=D0=BB=D0=B4=D0=B0=D2=93=D1=8B =D0=B5=D1=81=D0=BA=D0=B5= =D1=80=D1=82=D1=83=D0=BB=D0=B5=D1=80 -Name[km]=3D=E1=9E=87=E1=9E=BC=E1=9E=93=E2=80=8B=E1=9E=8A=E1=9F=86=E1=9E=8E= =E1=9E=B9=E1=9E=84=E2=80=8B=E1=9E=80=E1=9F=92=E1=9E=93=E1=9E=BB=E1=9E=84=E2= =80=8B=E1=9E=AF=E1=9E=80=E1=9E=9F=E1=9E=B6=E1=9E=9A=E2=80=8B=E1=9E=98=E1=9E= =BC=E1=9E=9B=E1=9E=8A=E1=9F=92=E1=9E=8B=E1=9E=B6=E1=9E=93 -Name[ko]=3D=EB=A1=9C=EC=BB=AC =ED=8C=8C=EC=9D=BC=EC=97=90 =EC=A0=80=EC=9E= =A5=ED=95=9C =EC=95=8C=EB=9E=8C -Name[lt]=3DPriminimai vietiniame faile -Name[lv]=3DAtg=C4=81din=C4=81jumi lok=C4=81l=C4=81 fail=C4=81 -Name[mr]=3D=E0=A4=B8=E0=A5=8D=E0=A4=A5=E0=A4=BE=E0=A4=A8=E0=A4=BF=E0=A4=95= =E0=A4=AB=E0=A4=BE=E0=A4=88=E0=A4=B2=E0=A5=80=E0=A4=A4=E0=A5=80=E0=A4=B2 = =E0=A4=8F=E0=A4=B2=E0=A4=BE=E0=A4=B0=E0=A5=8D=E0=A4=AE=E0=A5=8D=E0=A4=B8 -Name[nb]=3DVarslinger i lokal fil -Name[nds]=3DAlarms binnen lokaal Datei -Name[ne]=3D=E0=A4=B8=E0=A5=8D=E0=A4=A5=E0=A4=BE=E0=A4=A8=E0=A5=80=E0=A4=AF= =E0=A4=AB=E0=A4=BE=E0=A4=87=E0=A4=B2=E0=A4=AE=E0=A4=BE =E0=A4=B8=E0=A4=82= =E0=A4=B8=E0=A5=82=E0=A4=9A=E0=A4=95 -Name[nl]=3DHerinneringen in lokaal bestand -Name[nn]=3DAlarmar i lokal fil -Name[pa]=3D=E0=A8=B2=E0=A9=8B=E0=A8=95=E0=A8=B2 =E0=A8=AB=E0=A8=BE=E0=A8= =87=E0=A8=B2 =E0=A8=B5=E0=A8=BF=E0=A9=B1=E0=A8=9A =E0=A8=85=E0=A8=B2=E0=A8= =BE=E0=A8=B0=E0=A8=AE -Name[pl]=3DAlarmy w pliku lokalnym -Name[pt]=3DAlarmes num Ficheiro Local -Name[pt_BR]=3DAlarmes em arquivo local -Name[ro]=3DAlarme =C3=AEn fi=C8=99ier local -Name[ru]=3D=D0=9D=D0=B0=D0=BF=D0=BE=D0=BC=D0=B8=D0=BD=D0=B0=D0=BD=D0=B8=D1= =8F =D0=B2 =D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=BC =D1=84=D0= =B0=D0=B9=D0=BB=D0=B5 -Name[sk]=3DAlarmy v lok=C3=A1lnom s=C3=BAbore -Name[sl]=3DAlarmi v krajevni datoteki -Name[sr]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 =D1=83 =D0=BB=D0=BE=D0=BA= =D0=B0=D0=BB=D0=BD=D0=BE=D0=BC =D1=84=D0=B0=D1=98=D0=BB=D1=83 -Name[sr@ijekavian]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 =D1=83 =D0=BB=D0= =BE=D0=BA=D0=B0=D0=BB=D0=BD=D0=BE=D0=BC =D1=84=D0=B0=D1=98=D0=BB=D1=83 -Name[sr@ijekavianlatin]=3DAlarmi u lokalnom fajlu -Name[sr@latin]=3DAlarmi u lokalnom fajlu -Name[sv]=3DAlarm i lokal fil -Name[tr]=3DYerel Dosyadaki Alarmlar -Name[uk]=3D=D0=9D=D0=B0=D0=B3=D0=B0=D0=B4=D1=83=D0=B2=D0=B0=D0=BD=D0=BD=D1= =8F =D0=B2 =D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=BC=D1=83 =D1= =84=D0=B0=D0=B9=D0=BB=D1=96 -Name[wa]=3DXh=C3=AEletes e-n on fitch=C3=AE coinrece -Name[x-test]=3DxxAlarms in Local Filexx -Name[zh_CN]=3D=E6=9C=AC=E5=9C=B0=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9A=84=E6=8F= =90=E9=86=92=E4=BA=8B=E9=A1=B9 -Name[zh_TW]=3D=E6=9C=AC=E5=9C=B0=E6=AA=94=E6=A1=88=E4=B8=AD=E7=9A=84=E9=AC= =A7=E9=90=98 -Comment=3DProvides access to an alarm calendar stored in a single local fi= le -Comment[ar]=3D=D9=8A=D9=88=D9=81=D8=B1 =D8=A7=D9=84=D9=88=D8=B5=D9=88=D9= =84 =D9=84=D9=85=D9=86=D8=A8=D9=87 =D8=A7=D9=84=D8=AA=D9=82=D9=88=D9=8A=D9= =85 =D8=A7=D9=84=D9=85=D8=AD=D9=81=D9=88=D8=B8 =D9=81=D9=8A =D9=85=D9=84=D9= =81 =D9=85=D8=AD=D9=84=D9=8A =D9=85=D9=81=D8=B1=D8=AF -Comment[bs]=3DObezbje=C4=91uje prostup alarm kalendaru sa=C4=8Duvanom u je= dnoj lokalnoj datoteci -Comment[ca]=3DProporciona acc=C3=A9s a un calendari d'alarmes emmagatzemat= en un fitxer local individual -Comment[ca@valencia]=3DProporciona l'acc=C3=A9s a un calendari d'alarmes e= mmagatzemat en un fitxer local individual -Comment[cs]=3DPoskytuje p=C5=99=C3=ADstup ke kalend=C3=A1=C5=99i alarmu ul= o=C5=BEen=C3=A9m v jednom lok=C3=A1ln=C3=ADm souboru -Comment[da]=3DGiver adgang til en alarmkalender lagret i en enkelt lokal f= il -Comment[de]=3DErm=C3=B6glicht den Zugriff auf einen Erinnerungen-Kalender = in einer lokalen Datei. -Comment[el]=3D=CE=A0=CF=81=CE=BF=CF=83=CF=86=CE=AD=CF=81=CE=B5=CE=B9 =CF= =80=CF=81=CF=8C=CF=83=CE=B2=CE=B1=CF=83=CE=B7 =CF=83=CE=B5 =CE=B7=CE=BC=CE= =B5=CF=81=CE=BF=CE=BB=CF=8C=CE=B3=CE=B9=CE=BF =CF=83=CF=85=CE=BD=CE=B1=CE= =B3=CE=B5=CF=81=CE=BC=CF=8E=CE=BD =CE=B1=CF=80=CE=BF=CE=B8=CE=B7=CE=BA=CE= =B5=CF=85=CE=BC=CE=AD=CE=BD=CE=BF =CF=83=CE=B5 =CE=AD=CE=BD=CE=B1 =CF=84=CE= =BF=CF=80=CE=B9=CE=BA=CF=8C =CE=B1=CF=81=CF=87=CE=B5=CE=AF=CE=BF -Comment[en_GB]=3DProvides access to an alarm calendar stored in a single l= ocal file -Comment[es]=3DProvee acceso al calendario de alarmas almacenado en un solo= archivo local -Comment[et]=3DV=C3=B5imaldab kasutada kohalikku faili salvestatud h=C3=A4i= rete kalendrit -Comment[fi]=3DTarjoaa p=C3=A4=C3=A4syn yksitt=C3=A4iseen paikalliseen tied= ostoon tallennettuun h=C3=A4lytyskalenteriin -Comment[fr]=3DFournit l'acc=C3=A8s aux alarmes de calendrier stock=C3=A9es= dans un unique fichier -Comment[gl]=3DD=C3=A1 aceso a un calendario de alarmas gardado nun ficheir= o local -Comment[hu]=3DHelyi f=C3=A1jlban t=C3=A1rolt eml=C3=A9keztet=C5=91kh=C3=B6= z biztos=C3=ADt hozz=C3=A1f=C3=A9r=C3=A9st -Comment[ia]=3DForni accesso a un calendario de alarma immagazinate in un s= ingule file local -Comment[it]=3DConsente l'accesso a degli avvisi memorizzati in un file loc= ale -Comment[ja]=3D=E5=8D=98=E4=B8=80=E3=81=AE=E3=83=AD=E3=83=BC=E3=82=AB=E3=83= =AB=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E4=BF=9D=E5=AD=98=E3=81=95= =E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=82=A2=E3=83=A9=E3=83=BC=E3=83=A0=E3= =82=AB=E3=83=AC=E3=83=B3=E3=83=80=E3=83=BC=E3=81=B8=E3=81=AE=E3=82=A2=E3=82= =AF=E3=82=BB=E3=82=B9=E3=82=92=E6=8F=90=E4=BE=9B=E3=81=97=E3=81=BE=E3=81=99 -Comment[kk]=3D=D0=91=D1=96=D1=80 =D0=B6=D0=B5=D1=80=D0=B3=D1=96=D0=BB=D1= =96=D0=BA=D1=82=D1=96 =D1=84=D0=B0=D0=B9=D0=BB=D0=B4=D0=B0=D2=93=D1=8B =D0= =B5=D1=81=D0=BA=D0=B5=D1=80=D1=82=D1=83=D0=BB=D0=B5=D1=80 =D0=BA=D2=AF=D0= =BD=D1=82=D1=96=D0=B7=D0=B1=D0=B5=D0=B3=D0=B5 =D2=9B=D0=B0=D1=82=D1=8B=D0= =BD=D0=B0=D1=83 -Comment[km]=3D=E1=9E=95=E1=9F=92=E1=9E=8A=E1=9E=9B=E1=9F=8B=E2=80=8B=E1=9E= =9F=E1=9E=B7=E1=9E=91=E1=9F=92=E1=9E=92=E1=9E=B7=E2=80=8B=E1=9E=85=E1=9E=BC= =E1=9E=9B=E2=80=8B=E1=9E=8A=E1=9F=86=E1=9E=8E=E1=9E=BE=E1=9E=9A=E1=9E=80=E1= =9E=B6=E1=9E=9A=E2=80=8B=E1=9E=91=E1=9F=85=E2=80=8B=E1=9E=94=E1=9F=92=E1=9E= =9A=E1=9E=8F=E1=9E=B7=E1=9E=91=E1=9E=B7=E1=9E=93=E2=80=8B=E1=9E=87=E1=9E=BC= =E1=9E=93=E2=80=8B=E1=9E=8A=E1=9F=86=E1=9E=8E=E1=9E=B9=E1=9E=84 =E1=9E=8A= =E1=9F=82=E1=9E=9B=E2=80=8B=E1=9E=94=E1=9E=B6=E1=9E=93=E2=80=8B=E1=9E=91=E1= =9E=BB=E1=9E=80=E2=80=8B=E1=9E=93=E1=9F=85=E2=80=8B=E1=9E=80=E1=9F=92=E1=9E= =93=E1=9E=BB=E1=9E=84=E2=80=8B=E1=9E=AF=E1=9E=80=E1=9E=9F=E1=9E=B6=E1=9E=9A= =E2=80=8B=E1=9E=98=E1=9E=BC=E1=9E=9B=E1=9E=8A=E1=9F=92=E1=9E=8B=E1=9E=B6=E1= =9E=93=E2=80=8B=E2=80=8B -Comment[ko]=3D=EB=8B=A8=EC=9D=BC =EB=A1=9C=EC=BB=AC =ED=8C=8C=EC=9D=BC=EC= =97=90 =EC=A0=80=EC=9E=A5=EB=90=98=EC=96=B4 =EC=9E=88=EB=8A=94 =EC=95=8C=EB= =9E=8C =EB=8B=AC=EB=A0=A5=EC=97=90 =EC=A0=91=EA=B7=BC=ED=95=98=EA=B8=B0 -Comment[lt]=3DSuteikia pri=C4=97jim=C4=85 prie priminim=C5=B3 kalendoriaus= vietiniame faile -Comment[lv]=3DNodro=C5=A1ina piek=C4=BCuvi atg=C4=81din=C4=81jumu kalend= =C4=81ram, kas glab=C4=81jas vien=C4=81 lok=C4=81l=C4=81 fail=C4=81 -Comment[nb]=3DGir tilgang til en varslingskalender lagret i en enkelt loka= l fil -Comment[nds]=3DStellt Togriep op en binnen en enkelte lokaale Datei wohrte= n Alarm-Kalenner praat -Comment[nl]=3DGeeft toegang naar een herinneringagenda, die in een enkel l= okaal bestand opgeslagen is -Comment[nn]=3DGjev tilgang til alarmkalendrar lagra i lokale filer -Comment[pl]=3DZapewnia dost=C4=99p do kalendarza alarm=C3=B3w przechowywan= ego w pojedy=C5=84czym pliku lokalnym -Comment[pt]=3DOferece o acesso a um calend=C3=A1rio de alarmes guardado nu= m =C3=BAnico ficheiro local -Comment[pt_BR]=3DFornece acesso a um calend=C3=A1rio de alarmes armazenado= em um =C3=BAnico arquivo local -Comment[ro]=3DOfer=C4=83 acces la un calendar de alarme stocat =C3=AEntr-u= n singur fi=C8=99ier local -Comment[ru]=3D=D0=A5=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5 =D0=BD=D0= =B0=D0=BF=D0=BE=D0=BC=D0=B8=D0=BD=D0=B0=D0=BD=D0=B8=D0=B9 =D0=B2 =D0=BB=D0= =BE=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=BC =D1=84=D0=B0=D0=B9=D0=BB=D0= =B5 -Comment[sk]=3DUmo=C5=BE=C5=88uje pr=C3=ADstup do kalend=C3=A1ra alarmov ul= o=C5=BEen=C3=BD v jednoduchom lok=C3=A1lnom s=C3=BAbore -Comment[sl]=3DOmogo=C4=8Da dostop do koledarja z alarmi, ki je shranjen v = eni krajevni datoteki -Comment[sr]=3D=D0=9E=D0=BC=D0=BE=D0=B3=D1=83=D1=9B=D0=B0=D0=B2=D0=B0 =D0= =BF=D1=80=D0=B8=D1=81=D1=82=D1=83=D0=BF =D0=B0=D0=BB=D0=B0=D1=80=D0=BC=D0= =BD=D0=BE=D0=BC =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80=D1=83 =D1= =81=D0=BC=D0=B5=D1=88=D1=82=D0=B5=D0=BD=D0=BE=D0=BC =D1=83 =D1=98=D0=B5=D0= =B4=D0=BD=D0=BE=D0=BC =D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D0=BD=D0=BE=D0=BC =D1= =84=D0=B0=D1=98=D0=BB=D1=83 -Comment[sr@ijekavian]=3D=D0=9E=D0=BC=D0=BE=D0=B3=D1=83=D1=9B=D0=B0=D0=B2= =D0=B0 =D0=BF=D1=80=D0=B8=D1=81=D1=82=D1=83=D0=BF =D0=B0=D0=BB=D0=B0=D1=80= =D0=BC=D0=BD=D0=BE=D0=BC =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80= =D1=83 =D1=81=D0=BC=D0=B5=D1=88=D1=82=D0=B5=D0=BD=D0=BE=D0=BC =D1=83 =D1=98= =D0=B5=D0=B4=D0=BD=D0=BE=D0=BC =D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D0=BD=D0=BE= =D0=BC =D1=84=D0=B0=D1=98=D0=BB=D1=83 -Comment[sr@ijekavianlatin]=3DOmogu=C4=87ava pristup alarmnom kalendaru sme= =C5=A1tenom u jednom lokalnom fajlu -Comment[sr@latin]=3DOmogu=C4=87ava pristup alarmnom kalendaru sme=C5=A1ten= om u jednom lokalnom fajlu -Comment[sv]=3DGer tillg=C3=A5ng till en alarmkalender lagrad i en enda lok= al fil -Comment[tr]=3DTek bir yerel dosyada depolanm=C4=B1=C5=9F bir alarm takvimi= ne eri=C5=9Fim sa=C4=9Flar -Comment[uk]=3D=D0=9D=D0=B0=D0=B4=D0=B0=D1=94 =D0=B4=D0=BE=D1=81=D1=82=D1= =83=D0=BF =D0=B4=D0=BE =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80=D1= =8F =D0=BD=D0=B0=D0=B3=D0=B0=D0=B4=D1=83=D0=B2=D0=B0=D0=BD=D1=8C, =D1=8F=D0= =BA=D0=B8=D0=B9 =D0=B7=D0=B1=D0=B5=D1=80=D1=96=D0=B3=D0=B0=D1=94=D1=82=D1= =8C=D1=81=D1=8F =D1=83 =D0=BE=D0=BA=D1=80=D0=B5=D0=BC=D0=BE=D0=BC=D1=83 =D0= =BB=D0=BE=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=BC=D1=83 =D1=84=D0=B0=D0= =B9=D0=BB=D1=96 -Comment[wa]=3DDene l'=C2=A0acc=C3=A8s a on calindr=C3=AE di xh=C3=AEletes = stok=C3=A9 dins on seu fitch=C3=AE coinrece -Comment[x-test]=3DxxProvides access to an alarm calendar stored in a singl= e local filexx -Comment[zh_CN]=3D=E6=8F=90=E4=BE=9B=E5=AF=B9=E5=AD=98=E5=82=A8=E5=9C=A8=E5= =8D=95=E4=B8=AA=E6=9C=AC=E5=9C=B0=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9A=84=E6=8F= =90=E9=86=92=E6=97=A5=E5=8E=86=E7=9A=84=E8=AE=BF=E9=97=AE=E6=94=AF=E6=8C=81 -Comment[zh_TW]=3D=E6=8F=90=E4=BE=9B=E5=AD=98=E5=8F=96=E5=84=B2=E5=AD=98=E5= =9C=A8=E6=9C=AC=E5=9C=B0=E6=AA=94=E6=A1=88=E4=B8=AD=E7=9A=84=E9=AC=A7=E9=90= =98=E8=A1=8C=E4=BA=8B=E6=9B=86=E7=9A=84=E5=8A=9F=E8=83=BD -X-KDE-Library=3Dkalarm_local -Type=3DService -X-KDE-ServiceTypes=3DKResources/Plugin -X-KDE-ResourceFamily=3Dalarms -X-KDE-ResourceType=3Dfile diff --git a/kalarm/resources/localdir.desktop b/kalarm/resources/localdir.= desktop deleted file mode 100644 index ffaf957..0000000 --- a/kalarm/resources/localdir.desktop +++ /dev/null @@ -1,104 +0,0 @@ -[Desktop Entry] -Name=3DAlarms in Local Directory -Name[ar]=3D=D8=A7=D9=84=D8=AA=D9=86=D8=A8=D9=8A=D9=87=D8=A7=D8=AA =D9=81= =D9=8A =D8=A7=D9=84=D8=AF=D9=84=D9=8A=D9=84 =D8=A7=D9=84=D9=85=D8=AD=D9=84= =D9=8A -Name[be]=3D=D0=9A=D0=B0=D0=BB=D1=8F=D0=BD=D0=B4=D0=B0=D1=80 =D1=83 =D0=BC= =D1=8F=D1=81=D1=86=D0=BE=D0=B2=D0=B0=D0=B9 =D1=82=D1=8D=D1=87=D1=86=D1=8B -Name[bg]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 =D0=B2 =D0=BB=D0=BE=D0=BA= =D0=B0=D0=BB=D0=BD=D0=B0 =D0=B4=D0=B8=D1=80=D0=B5=D0=BA=D1=82=D0=BE=D1=80= =D0=B8=D1=8F -Name[bs]=3DAlarmi u lokalnom direktoriju -Name[ca]=3DAlarmes en un directori local -Name[ca@valencia]=3DAlarmes en un directori local -Name[cs]=3DAlarmy v m=C3=ADstn=C3=AD slo=C5=BEce -Name[da]=3DAlarmer i lokal mappe -Name[de]=3DErinnerungen in lokalem Ordner -Name[el]=3D=CE=A3=CF=85=CE=BD=CE=B1=CE=B3=CE=B5=CF=81=CE=BC=CE=BF=CE=AF = =CF=83=CE=B5 =CF=84=CE=BF=CF=80=CE=B9=CE=BA=CF=8C =CE=BA=CE=B1=CF=84=CE=AC= =CE=BB=CE=BF=CE=B3=CE=BF -Name[en_GB]=3DAlarms in Local Directory -Name[es]=3DAlarmas en un directorio local -Name[et]=3DH=C3=A4ired kohalikus kataloogis -Name[fa]=3D=D9=87=D8=B4=D8=AF=D8=A7=D8=B1=D9=87=D8=A7 =D8=AF=D8=B1 =D9=81= =D9=87=D8=B1=D8=B3=D8=AA =D8=B1=D8=A7=D9=87=D9=86=D9=85=D8=A7=DB=8C =D9=85= =D8=AD=D9=84=DB=8C -Name[fi]=3DH=C3=A4lytykset paikallisessa kansiossa -Name[fr]=3DAlarmes dans un dossier local -Name[ga]=3DAl=C3=A1raim i gComhadlann Log=C3=A1nta -Name[gl]=3DAlarmas nun directorio local -Name[hu]=3DHelyi mapp=C3=A1ban t=C3=A1rolt eml=C3=A9keztet=C5=91k -Name[ia]=3DAlarmas in directorio local -Name[it]=3DAvvisi in una directory locale -Name[ja]=3D=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB=E3=83=87=E3=82=A3=E3=83=AC= =E3=82=AF=E3=83=88=E3=83=AA=E3=81=AE=E3=82=A2=E3=83=A9=E3=83=BC=E3=83=A0 -Name[kk]=3D=D0=96=D0=B5=D1=80=D0=B3=D1=96=D0=BB=D1=96=D0=BA=D1=82=D1=96 = =D0=BA=D0=B0=D0=BF=D1=88=D1=8B=D2=9B=D1=82=D0=B0=D2=93=D1=8B =D0=B5=D1=81= =D0=BA=D0=B5=D1=80=D1=82=D1=83=D0=BB=D0=B5=D1=80 -Name[km]=3D=E1=9E=87=E1=9E=BC=E1=9E=93=E2=80=8B=E1=9E=8A=E1=9F=86=E1=9E=8E= =E1=9E=B9=E1=9E=84=E2=80=8B=E1=9E=80=E1=9F=92=E1=9E=93=E1=9E=BB=E1=9E=84=E2= =80=8B=E1=9E=90=E1=9E=8F=E2=80=8B=E1=9E=98=E1=9E=BC=E1=9E=9B=E1=9E=8A=E1=9F= =92=E1=9E=8B=E1=9E=B6=E1=9E=93=E2=80=8B=E2=80=8B=E2=80=8B -Name[ko]=3D=EB=A1=9C=EC=BB=AC =EB=94=94=EB=A0=89=ED=84=B0=EB=A6=AC=EC=97= =90 =EC=A0=80=EC=9E=A5=ED=95=9C =EC=95=8C=EB=9E=8C -Name[lt]=3DPriminimai vietiniame aplanke -Name[lv]=3DAtg=C4=81din=C4=81jumi lok=C4=81l=C4=81 map=C4=93 -Name[mr]=3D=E0=A4=B8=E0=A5=8D=E0=A4=A5=E0=A4=BE=E0=A4=A8=E0=A4=BF=E0=A4=95= =E0=A4=B8=E0=A4=82=E0=A4=9A=E0=A4=AF=E0=A5=80=E0=A4=95=E0=A5=87=E0=A4=A4= =E0=A5=80=E0=A4=B2 =E0=A4=8F=E0=A4=B2=E0=A4=BE=E0=A4=B0=E0=A5=8D=E0=A4=AE= =E0=A5=8D=E0=A4=B8 -Name[nb]=3DVarslinger i lokal katalog -Name[nds]=3DAlarms binnen lokaal Orner -Name[ne]=3D=E0=A4=B8=E0=A5=8D=E0=A4=A5=E0=A4=BE=E0=A4=A8=E0=A5=80=E0=A4=AF= =E0=A4=A1=E0=A4=BE=E0=A4=87=E0=A4=B0=E0=A5=87=E0=A4=95=E0=A5=8D=E0=A4=9F= =E0=A4=B0=E0=A5=80=E0=A4=AE=E0=A4=BE =E0=A4=B8=E0=A4=82=E0=A4=B8=E0=A5=82= =E0=A4=9A=E0=A4=95 -Name[nl]=3DHerinneringen in lokale map -Name[nn]=3DAlarmar i lokal mappe -Name[pa]=3D=E0=A8=B2=E0=A9=8B=E0=A8=95=E0=A8=B2 =E0=A8=A1=E0=A8=BE=E0=A8= =87=E0=A8=B0=E0=A9=88=E0=A8=95=E0=A8=9F=E0=A8=B0=E0=A9=80 =E0=A8=B5=E0=A8= =BF=E0=A9=B1=E0=A8=9A =E0=A8=85=E0=A8=B2=E0=A8=BE=E0=A8=B0=E0=A8=AE -Name[pl]=3DAlarmy w katalogu lokalnym -Name[pt]=3DAlarmes numa Pasta Local -Name[pt_BR]=3DAlarmes em pasta local -Name[ro]=3DAlarme =C3=AEn dosar local -Name[ru]=3D=D0=9D=D0=B0=D0=BF=D0=BE=D0=BC=D0=B8=D0=BD=D0=B0=D0=BD=D0=B8=D1= =8F =D0=B2 =D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9 =D0=BF=D0= =B0=D0=BF=D0=BA=D0=B5 -Name[sk]=3DAlarmy v lok=C3=A1lnom prie=C4=8Dinku -Name[sl]=3DAlarmi v krajevnem imeniku -Name[sr]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 =D1=83 =D0=BB=D0=BE=D0=BA= =D0=B0=D0=BB=D0=BD=D0=BE=D1=98 =D1=84=D0=B0=D1=81=D1=86=D0=B8=D0=BA=D0=BB= =D0=B8 -Name[sr@ijekavian]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 =D1=83 =D0=BB=D0= =BE=D0=BA=D0=B0=D0=BB=D0=BD=D0=BE=D1=98 =D1=84=D0=B0=D1=81=D1=86=D0=B8=D0= =BA=D0=BB=D0=B8 -Name[sr@ijekavianlatin]=3DAlarmi u lokalnoj fascikli -Name[sr@latin]=3DAlarmi u lokalnoj fascikli -Name[sv]=3DAlarm i lokal katalog -Name[tr]=3DYerel Dizinlerdeki Alarmlar -Name[uk]=3D=D0=9D=D0=B0=D0=B3=D0=B0=D0=B4=D1=83=D0=B2=D0=B0=D0=BD=D0=BD=D1= =8F =D0=B2 =D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=BC=D1=83 =D0= =BA=D0=B0=D1=82=D0=B0=D0=BB=D0=BE=D0=B7=D1=96 -Name[wa]=3DXh=C3=AEletes e-n on ridant coinrece -Name[x-test]=3DxxAlarms in Local Directoryxx -Name[zh_CN]=3D=E6=9C=AC=E5=9C=B0=E7=9B=AE=E5=BD=95=E4=B8=AD=E7=9A=84=E6=8F= =90=E9=86=92=E4=BA=8B=E9=A1=B9 -Name[zh_TW]=3D=E6=9C=AC=E5=9C=B0=E7=9B=AE=E9=8C=84=E4=B8=AD=E7=9A=84=E9=AC= =A7=E9=90=98 -Comment=3DProvides access to an alarm calendar stored in a local directory= , in which each calendar item is stored in a separate file -Comment[ar]=3D=D9=8A=D9=88=D9=81=D8=B1 =D9=88=D8=B5=D9=88=D9=84 =D9=84=D9= =85=D9=86=D8=A8=D9=87 =D8=A7=D9=84=D8=AA=D9=82=D9=88=D9=8A=D9=85 =D8=A7=D9= =84=D9=85=D8=AD=D9=81=D9=88=D8=B8 =D9=81=D9=8A =D8=A7=D9=84=D8=AF=D9=84=D9= =8A=D9=84 =D8=A7=D9=84=D9=85=D8=AD=D9=84=D9=8A =D8=8C =D8=A8=D8=AD=D9=8A=D8= =AB =D9=83=D9=84 =D8=B9=D9=86=D8=B5=D8=B1 =D8=AA=D9=82=D9=88=D9=8A=D9=85 = =D9=85=D8=AD=D9=81=D9=88=D8=B8 =D9=81=D9=8A =D9=85=D9=84=D9=81 =D9=85=D9= =86=D9=81=D8=B1=D8=AF -Comment[bs]=3DObezbje=C4=91uje prostup alarm kalendaru sa=C4=8Duvanom u lo= kalnom direktoriju, u kojem svaki od kalendarskih primjeraka je sa=C4=8Duva= n u odvojenoj datoteci -Comment[ca]=3DProporciona acc=C3=A9s a un calendari d'alarmes emmagatzemat= en un directori local, en el que cada element del calendari est=C3=A0 emma= gatzemat en un fitxer separat -Comment[ca@valencia]=3DProporciona l'acc=C3=A9s a un calendari d'alarmes e= mmagatzemat en un directori local, en el que cada element del calendari est= =C3=A0 emmagatzemat en un fitxer separat -Comment[da]=3DGiver adgang til en alarmkalender lagret i en lokal mappe, h= vori hvert enkelt kalenderelement lagres i en seperat fil -Comment[de]=3DErm=C3=B6glicht den Zugriff auf einen Erinnerungen-Kalender = in einem lokalen Ordner, in dem jeder Kalender-Eintrag als separate Datei g= espeichert ist. -Comment[el]=3D=CE=A0=CF=81=CE=BF=CF=83=CF=86=CE=AD=CF=81=CE=B5=CE=B9 =CF= =80=CF=81=CF=8C=CF=83=CE=B2=CE=B1=CF=83=CE=B7 =CF=83=CE=B5 =CE=B7=CE=BC=CE= =B5=CF=81=CE=BF=CE=BB=CF=8C=CE=B3=CE=B9=CE=BF =CF=83=CF=85=CE=BD=CE=B1=CE= =B3=CE=B5=CF=81=CE=BC=CF=8E=CE=BD =CE=B1=CF=80=CE=BF=CE=B8=CE=B7=CE=BA=CE= =B5=CF=85=CE=BC=CE=AD=CE=BD=CE=BF =CF=83=CE=B5 =CE=AD=CE=BD=CE=B1=CE=BD =CF= =84=CE=BF=CF=80=CE=B9=CE=BA=CF=8C =CE=BA=CE=B1=CF=84=CE=AC=CE=BB=CE=BF=CE= =B3=CE=BF, =CF=83=CF=84=CE=BF=CE=BD =CE=BF=CF=80=CE=BF=CE=AF=CE=BF =CE=BA= =CE=AC=CE=B8=CE=B5 =CE=B1=CE=BD=CF=84=CE=B9=CE=BA=CE=B5=CE=AF=CE=BC=CE=B5= =CE=BD=CE=BF =CE=B1=CF=80=CE=BF=CE=B8=CE=B7=CE=BA=CE=B5=CF=8D=CE=B5=CF=84= =CE=B1=CE=B9 =CF=83=CE=B5 =CE=BE=CE=B5=CF=87=CF=89=CF=81=CE=B9=CF=83=CF=84= =CF=8C =CE=B1=CF=81=CF=87=CE=B5=CE=AF=CE=BF -Comment[en_GB]=3DProvides access to an alarm calendar stored in a local di= rectory, in which each calendar item is stored in a separate file -Comment[es]=3DProvee acceso a un calendario de alarmas almacenado en un di= rectorio local, en el cual cada elemento del calendario es almacenado en un= archivo separado -Comment[et]=3DV=C3=B5imaldab kasutada kohalikku kataloogi salvestatud h=C3= =A4irete kalendrit, kus iga kalender on salvestatud eraldi faili -Comment[fi]=3DTarjoaa p=C3=A4=C3=A4syn paikalliseen kansioon tallennettuun= h=C3=A4lytyskalenteriin, jossa jokainen kalenteritietue on erillinen tiedo= sto -Comment[fr]=3DFournit l'acc=C3=A8s aux alarmes de calendrier stock=C3=A9es= dans un dossier=C2=A0; chaque entr=C3=A9e du calendrier =C3=A9tant stock= =C3=A9e dans un fichier distinct -Comment[gl]=3DPermite acceder a un calendario de alarmas almacenado nun di= rectorio local no que cada elemento do calendario se almacena nun ficheiro = diferente -Comment[hu]=3DHelyi mapp=C3=A1ban t=C3=A1rolt eml=C3=A9keztet=C5=91kh=C3= =B6z biztos=C3=ADt hozz=C3=A1f=C3=A9r=C3=A9st (minden bejegyz=C3=A9s k=C3= =BCl=C3=B6n f=C3=A1jlban tal=C3=A1lhat=C3=B3) -Comment[ia]=3DForni accesso a un calendario de alarma immagazinate in un d= irectorio local, in le qual cata elemento de calendario es immagazinate in= un file separate -Comment[it]=3DConsente l'accesso a degli avvisi memorizzati in una directo= ry locale, in cui ogni voce di calendario =C3=A8 memorizzato in un file sep= arato -Comment[ja]=3D=E3=82=AB=E3=83=AC=E3=83=B3=E3=83=80=E3=83=BC=E3=82=A2=E3=82= =A4=E3=83=86=E3=83=A0=E3=81=8C=E3=81=9D=E3=82=8C=E3=81=9E=E3=82=8C=E5=80=8B= =E5=88=A5=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E4=BF=9D=E5= =AD=98=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=83=AD=E3=83=BC=E3=82= =AB=E3=83=AB=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA=E3=81=AE= =E3=82=A2=E3=83=A9=E3=83=BC=E3=83=A0=E3=82=AB=E3=83=AC=E3=83=B3=E3=83=80=E3= =83=BC=E3=81=B8=E3=81=AE=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9=E3=82=92=E6=8F= =90=E4=BE=9B=E3=81=97=E3=81=BE=E3=81=99 -Comment[kk]=3D=D3=98=D1=80=D0=B1=D1=96=D1=80 =D0=BA=D2=AF=D0=BD=D1=82=D1= =96=D0=B7=D0=B1=D0=B5 =D0=BE=D2=9B=D0=B8=D2=93=D0=B0=D1=81=D1=8B =D0=B1=D3= =A9=D0=BB=D0=B5=D0=BA =D1=84=D0=B0=D0=B9=D0=BB=D0=B4=D0=B0 =D1=81=D0=B0=D2= =9B=D1=82=D0=B0=D0=BB=D2=93=D0=B0=D0=BD =D0=B6=D0=B5=D1=80=D0=B3=D1=96=D0= =BB=D1=96=D0=BA=D1=82=D1=96 =D2=9B=D0=B0=D0=BF=D1=88=D1=8B=D2=9B=D1=82=D0= =B0=D2=93=D1=8B =D0=B5=D1=81=D0=BA=D0=B5=D1=80=D1=82=D1=83=D0=BB=D0=B5=D1= =80 =D0=BA=D2=AF=D0=BD=D1=82=D1=96=D0=B7=D0=B1=D0=B5=D0=B3=D0=B5 =D2=9B=D0= =B0=D1=82=D1=8B=D0=BD=D0=B0=D1=83 -Comment[km]=3D=E1=9E=95=E1=9F=92=E1=9E=8A=E1=9E=9B=E1=9F=8B=E2=80=8B=E1=9E= =9F=E1=9E=B7=E1=9E=91=E1=9F=92=E1=9E=92=E1=9E=B7=E2=80=8B=E1=9E=85=E1=9E=BC= =E1=9E=9B=E2=80=8B=E1=9E=8A=E1=9F=86=E1=9E=8E=E1=9E=BE=E1=9E=9A=E1=9E=80=E1= =9E=B6=E1=9E=9A=E2=80=8B=E1=9E=91=E1=9F=85=E1=9E=80=E1=9E=B6=E1=9E=93=E1=9F= =8B=E2=80=8B=E1=9E=94=E1=9F=92=E1=9E=9A=E1=9E=8F=E1=9E=B7=E1=9E=91=E1=9E=B7= =E1=9E=93=E2=80=8B=E1=9E=87=E1=9E=BC=E1=9E=93=E2=80=8B=E1=9E=8A=E1=9F=86=E1= =9E=8E=E1=9E=B9=E1=9E=84=E2=80=8B=E1=9E=8A=E1=9F=82=E1=9E=9B=E2=80=8B=E1=9E= =94=E1=9E=B6=E1=9E=93=E2=80=8B=E1=9E=9A=E1=9E=80=E1=9F=92=E1=9E=9F=E1=9E=B6= =E1=9E=91=E1=9E=BB=E1=9E=80=E2=80=8B=E1=9E=93=E1=9F=85=E2=80=8B=E1=9E=80=E1= =9F=92=E1=9E=93=E1=9E=BB=E1=9E=84=E2=80=8B=E1=9E=90=E1=9E=8F=E2=80=8B=E1=9E= =98=E1=9E=BC=E1=9E=9B=E1=9E=8A=E1=9F=92=E1=9E=8B=E1=9E=B6=E1=9E=93 =E1=9E= =8A=E1=9F=82=E1=9E=9B=E2=80=8B=E1=9E=92=E1=9E=B6=E1=9E=8F=E1=9E=BB=E2=80=8B= =E1=9E=94=E1=9F=92=E1=9E=9A=E1=9E=8F=E1=9E=B7=E1=9E=91=E1=9E=B7=E1=9E=93=E2= =80=8B=E1=9E=93=E1=9E=B8=E1=9E=98=E1=9E=BD=E1=9E=99=E1=9F=97=E2=80=8B=E1=9E= =82=E1=9E=BA=E2=80=8B=E1=9E=8F=E1=9F=92=E1=9E=9A=E1=9E=BC=E1=9E=9C=E1=9E=94= =E1=9E=B6=E1=9E=93=E2=80=8B=E1=9E=9A=E1=9E=80=E1=9F=92=E1=9E=9F=E1=9E=B6=E1= =9E=91=E1=9E=BB=E1=9E=80=E2=80=8B=E1=9E=87=E1=9E=B6=E2=80=8B=E1=9E=AF=E1=9E= =80=E1=9E=9F=E1=9E=B6=E1=9E=9A=E2=80=8B=E1=9E=8A=E1=9E=B6=E1=9E=85=E1=9F=8B= =E1=9E=8A=E1=9F=84=E1=9E=99=E1=9E=A1=E1=9F=82=E1=9E=80=E2=80=8B=E1=9E=96=E1= =9E=B8=E2=80=8B=E1=9E=82=E1=9F=92=E1=9E=93=E1=9E=B6 -Comment[ko]=3D=EC=95=8C=EB=9E=8C =EB=8B=AC=EB=A0=A5=EC=9D=98 =EA=B0=81=EA= =B0=81 =EB=8B=AC=EB=A0=A5 =ED=95=AD=EB=AA=A9=EC=9D=B4 =ED=8C=8C=EC=9D=BC=EB= =A1=9C =EC=A0=80=EC=9E=A5=EB=90=98=EC=96=B4 =EC=9E=88=EB=8A=94 =EB=A1=9C=EC= =BB=AC =EB=94=94=EB=A0=89=ED=84=B0=EB=A6=AC=EC=97=90 =EC=A0=91=EA=B7=BC=ED= =95=A9=EB=8B=88=EB=8B=A4 -Comment[lt]=3DSuteikia pri=C4=97jim=C4=85 prie priminim=C5=B3 kalendoriaus= vietiniame aplanke, kuriame kiekvienas =C4=AFvykis saugomas atskirame faile -Comment[lv]=3DNodro=C5=A1ina piek=C4=BCuvi atg=C4=81din=C4=81jumu kalend= =C4=81ram, kas glab=C4=81jas vien=C4=81 lok=C4=81l=C4=81 map=C4=93, katrs k= alend=C4=81rs atsvi=C5=A1=C4=B7=C4=81 fail=C4=81 -Comment[nb]=3DGir tilgang til en varslingskalender lagret i en lokal mappe= , der hver kalenderoppf=C3=B8ring er lagret i en separat fil -Comment[nds]=3DStellt Togriep op en binnen en lokalen Orner wohrten Alarm-= Kalenner praat, binnen den elk Kalennerindrag as enkelte Datei sekert is. -Comment[nl]=3DGeeft toegang naar een herinneringagenda in een lokaal opges= lagen map,waarbij iedere agenda in een apart bestand opgeslagen is -Comment[nn]=3DGjev tilgang til alarmkalendrar lagra i ei lokal mappe, der = kvart kalenderelement vert lagra i ei eiga fil. -Comment[pl]=3DZapewnia dost=C4=99p do kalendarza alarm=C3=B3w przechowywan= ego w lokalnym katalogu, w kt=C3=B3rym ka=C5=BCdy element kalendarza jest z= apisany w osobnym pliku -Comment[pt]=3DOferece o acesso a um calend=C3=A1rio de alarmes guardado nu= ma pasta local; cada item do calend=C3=A1rio =C3=A9 guardado num ficheiro e= m separado -Comment[pt_BR]=3DFornece acesso a um calend=C3=A1rio de alarmes armazenado= em um =C3=BAnico arquivo local, onde cada item do calend=C3=A1rio =C3=A9 a= rmazenado em um arquivo separado -Comment[ro]=3DOfer=C4=83 acces la un calendar de alarme stocat =C3=AEntr-u= n dosar local, cu fiecare element din calendar stocat =C3=AEntr-un fi=C8=99= ier separat -Comment[ru]=3D=D0=A5=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5 =D0=BD=D0= =B0=D0=BF=D0=BE=D0=BC=D0=B8=D0=BD=D0=B0=D0=BD=D0=B8=D0=B9 =D0=B2 =D0=BE=D1= =82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D1=85 =D1=84=D0=B0=D0=B9=D0=BB=D0= =B0=D1=85 =D0=B2 =D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9 =D0= =BF=D0=B0=D0=BF=D0=BA=D0=B5 -Comment[sk]=3DUmo=C5=BE=C5=88uje pr=C3=ADstup ku kalend=C3=A1ru alarmov ul= o=C5=BEen=C3=A9mu v lok=C3=A1lnom adres=C3=A1ri, v ktorom je ka=C5=BEd=C3= =A1 polo=C5=BEka kalend=C3=A1ra ulo=C5=BEen=C3=A1 v samostatnom s=C3=BAbore -Comment[sl]=3DOmogo=C4=8Da dostop do koledarja z alarmi, ki so shranjeni v= krajevni mapi, kjer je vsak alarm shranjen v lo=C4=8Deni datoteki -Comment[sr]=3D=D0=9E=D0=BC=D0=BE=D0=B3=D1=83=D1=9B=D0=B0=D0=B2=D0=B0 =D0= =BF=D1=80=D0=B8=D1=81=D1=82=D1=83=D0=BF =D0=B0=D0=BB=D0=B0=D1=80=D0=BC=D0= =BD=D0=BE=D0=BC =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80=D1=83 =D1= =81=D0=BC=D0=B5=D1=88=D1=82=D0=B5=D0=BD=D0=BE=D0=BC =D1=83 =D0=BB=D0=BE=D0= =BA=D0=B0=D0=BB=D0=BD=D0=BE=D1=98 =D1=84=D0=B0=D1=81=D1=86=D0=B8=D0=BA=D0= =BB=D0=B8 =D1=83 =D0=BA=D0=BE=D1=98=D0=BE=D1=98 =D1=98=D0=B5 =D1=81=D0=B2= =D0=B0=D0=BA=D0=B8 =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80 =D1=81= =D0=BC=D0=B5=D1=88=D1=82=D0=B5=D0=BD =D1=83 =D0=BF=D0=BE=D1=81=D0=B5=D0=B1= =D0=B0=D0=BD =D1=84=D0=B0=D1=98=D0=BB -Comment[sr@ijekavian]=3D=D0=9E=D0=BC=D0=BE=D0=B3=D1=83=D1=9B=D0=B0=D0=B2= =D0=B0 =D0=BF=D1=80=D0=B8=D1=81=D1=82=D1=83=D0=BF =D0=B0=D0=BB=D0=B0=D1=80= =D0=BC=D0=BD=D0=BE=D0=BC =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80= =D1=83 =D1=81=D0=BC=D1=98=D0=B5=D1=88=D1=82=D0=B5=D0=BD=D0=BE=D0=BC =D1=83 = =D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D0=BD=D0=BE=D1=98 =D1=84=D0=B0=D1=81=D1=86= =D0=B8=D0=BA=D0=BB=D0=B8 =D1=83 =D0=BA=D0=BE=D1=98=D0=BE=D1=98 =D1=98=D0=B5= =D1=81=D0=B2=D0=B0=D0=BA=D0=B8 =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0= =D1=80 =D1=81=D0=BC=D0=B5=D1=88=D1=82=D0=B5=D0=BD =D1=83 =D0=BF=D0=BE=D1=81= =D0=B5=D0=B1=D0=B0=D0=BD =D1=84=D0=B0=D1=98=D0=BB -Comment[sr@ijekavianlatin]=3DOmogu=C4=87ava pristup alarmnom kalendaru smj= e=C5=A1tenom u lokalnoj fascikli u kojoj je svaki kalendar sme=C5=A1ten u p= oseban fajl -Comment[sr@latin]=3DOmogu=C4=87ava pristup alarmnom kalendaru sme=C5=A1ten= om u lokalnoj fascikli u kojoj je svaki kalendar sme=C5=A1ten u poseban fajl -Comment[sv]=3DGer tillg=C3=A5ng till en alarmkalender lagrad i en lokal ka= talog, d=C3=A4r varje kalenderobjekt =C3=A4r lagrat i en separat fil -Comment[tr]=3DHer takvim =C3=B6gesinin ayr=C4=B1 bir dosyada depoland=C4= =B1=C4=9F=C4=B1 yerel bir dizinde depolanm=C4=B1=C5=9F bir alarm takvimine = eri=C5=9Fim sa=C4=9Flar -Comment[uk]=3D=D0=9D=D0=B0=D0=B4=D0=B0=D1=94 =D0=B4=D0=BE=D1=81=D1=82=D1= =83=D0=BF =D0=B4=D0=BE =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80=D1= =8F =D0=BD=D0=B0=D0=B3=D0=B0=D0=B4=D1=83=D0=B2=D0=B0=D0=BD=D1=8C, =D1=8F=D0= =BA=D0=B8=D0=B9 =D0=B7=D0=B1=D0=B5=D1=80=D1=96=D0=B3=D0=B0=D1=94=D1=82=D1= =8C=D1=81=D1=8F =D1=83 =D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0= =BC=D1=83 =D0=BA=D0=B0=D1=82=D0=B0=D0=BB=D0=BE=D0=B7=D1=96, =D0=B4=D0=B5 = =D0=BA=D0=BE=D0=B6=D0=B5=D0=BD =D0=B7=D0=B0=D0=BF=D0=B8=D1=81 =D0=BA=D0=B0= =D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80=D1=8F =D0=B7=D0=B1=D0=B5=D1=80=D1=96= =D0=B3=D0=B0=D1=94=D1=82=D1=8C=D1=81=D1=8F =D1=83 =D0=BE=D0=BA=D1=80=D0=B5= =D0=BC=D0=BE=D0=BC=D1=83 =D1=84=D0=B0=D0=B9=D0=BB=D1=96 -Comment[wa]=3DDene l'=C2=A0acc=C3=A8s a on calindr=C3=AE di xh=C3=AEletes = stok=C3=A9 dins on ridant coinrece, ki tchaeke cayet do calindr=C3=AE =C3= =AE est stok=C3=A9 dins on fitch=C3=AE a p=C3=A5rt -Comment[x-test]=3DxxProvides access to an alarm calendar stored in a local= directory, in which each calendar item is stored in a separate filexx -Comment[zh_CN]=3D=E6=8F=90=E4=BE=9B=E5=AF=B9=E5=AD=98=E5=82=A8=E5=9C=A8=E4= =B8=80=E4=B8=AA=E6=9C=AC=E5=9C=B0=E7=9B=AE=E5=BD=95=E4=B8=AD=E7=9A=84=E6=8F= =90=E9=86=92=E6=97=A5=E5=8E=86=E7=9A=84=E8=AE=BF=E9=97=AE=E6=94=AF=E6=8C=81= =EF=BC=8C=E6=AF=8F=E4=B8=AA=E6=97=A5=E5=8E=86=E9=A1=B9=E7=9B=AE=E9=83=BD=E5= =AD=98=E5=82=A8=E5=9C=A8=E5=90=84=E8=87=AA=E7=8B=AC=E7=AB=8B=E7=9A=84=E6=96= =87=E4=BB=B6=E5=86=85 -Comment[zh_TW]=3D=E6=8F=90=E4=BE=9B=E5=AD=98=E5=8F=96=E5=84=B2=E5=AD=98=E5= =9C=A8=E6=9C=AC=E5=9C=B0=E7=9B=AE=E9=8C=84=E4=B8=AD=E7=9A=84=E9=AC=A7=E9=90= =98=E8=A1=8C=E4=BA=8B=E6=9B=86=E7=9A=84=E5=8A=9F=E8=83=BD=E3=80=82=E6=AF=8F= =E4=B8=80=E5=80=8B=E8=A1=8C=E4=BA=8B=E6=9B=86=E6=98=AF=E5=96=AE=E7=8D=A8=E4= =B8=80=E5=80=8B=E6=AA=94=E6=A1=88 -X-KDE-Library=3Dkalarm_localdir -Type=3DService -X-KDE-ServiceTypes=3DKResources/Plugin -X-KDE-ResourceFamily=3Dalarms -X-KDE-ResourceType=3Dlocaldir diff --git a/kalarm/resources/remote.desktop b/kalarm/resources/remote.desk= top deleted file mode 100644 index 0c00787..0000000 --- a/kalarm/resources/remote.desktop +++ /dev/null @@ -1,104 +0,0 @@ -[Desktop Entry] -Name=3DAlarms in Remote File -Name[ar]=3D=D8=A7=D9=84=D8=AA=D9=86=D8=A8=D9=8A=D9=87=D8=A7=D8=AA =D9=81= =D9=8A =D9=85=D9=84=D9=81 =D8=A8=D8=B9=D9=8A=D8=AF -Name[be]=3D=D0=9A=D0=B0=D0=BB=D1=8F=D0=BD=D0=B4=D0=B0=D1=80 =D1=83 =D0=B0= =D0=B4=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D1=8B=D0=BC =D1=84=D0=B0=D0=B9=D0=BB= =D0=B5 -Name[bg]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 =D0=B2 =D0=BE=D1=82=D0=B4= =D0=B0=D0=BB=D0=B5=D1=87=D0=B5=D0=BD =D1=84=D0=B0=D0=B9=D0=BB -Name[bs]=3DAlarmi u udaljenoj datoteci -Name[ca]=3DAlarmes en un fitxer remot -Name[ca@valencia]=3DAlarmes en un fitxer remot -Name[cs]=3DAlarmy ve vzd=C3=A1len=C3=A9m souboru -Name[da]=3DAlarmer i ekstern fil -Name[de]=3DErinnerungen in Datei auf Fremdrechner -Name[el]=3D=CE=A3=CF=85=CE=BD=CE=B1=CE=B3=CE=B5=CF=81=CE=BC=CE=BF=CE=AF = =CF=83=CE=B5 =CE=B1=CF=80=CE=BF=CE=BC=CE=B1=CE=BA=CF=81=CF=85=CF=83=CE=BC= =CE=AD=CE=BD=CE=BF =CE=B1=CF=81=CF=87=CE=B5=CE=AF=CE=BF -Name[en_GB]=3DAlarms in Remote File -Name[es]=3DAlarmas en un archivo remoto -Name[et]=3DH=C3=A4ired v=C3=B5rgufailis -Name[fa]=3D=D9=87=D8=B4=D8=AF=D8=A7=D8=B1=D9=87=D8=A7 =D8=AF=D8=B1 =D9=BE= =D8=B1=D9=88=D9=86=D8=AF=D9=87 =D8=AF=D9=88=D8=B1 -Name[fi]=3DH=C3=A4lytykset et=C3=A4tiedostossa -Name[fr]=3DAlarmes dans un fichier distant -Name[ga]=3DAl=C3=A1raim i gCianchomhad -Name[gl]=3DAlarmas nun ficheiro remoto -Name[hu]=3DT=C3=A1voli f=C3=A1jlban t=C3=A1rolt eml=C3=A9keztet=C5=91k -Name[ia]=3DAlarmas in file remote -Name[it]=3DAvvisi in file remoto -Name[ja]=3D=E3=83=AA=E3=83=A2=E3=83=BC=E3=83=88=E3=83=95=E3=82=A1=E3=82=A4= =E3=83=AB=E3=81=AE=E3=82=A2=E3=83=A9=E3=83=BC=E3=83=A0 -Name[kk]=3D=D2=9A=D0=B0=D1=88=D1=8B=D2=9B=D1=82=D0=B0=D2=93=D1=8B =D1=84= =D0=B0=D0=B9=D0=BB=D0=B4=D0=B0=D2=93=D1=8B =D0=B5=D1=81=D0=BA=D0=B5=D1=80= =D1=82=D1=83=D0=BB=D0=B5=D1=80 -Name[km]=3D=E1=9E=87=E1=9E=BC=E1=9E=93=E2=80=8B=E1=9E=8A=E1=9F=86=E1=9E=8E= =E1=9E=B9=E1=9E=84=E2=80=8B=E1=9E=80=E1=9F=92=E1=9E=93=E1=9E=BB=E1=9E=84=E2= =80=8B=E1=9E=AF=E1=9E=80=E1=9E=9F=E1=9E=B6=E1=9E=9A=E2=80=8B=E1=9E=96=E1=9E= =B8=E2=80=8B=E1=9E=85=E1=9E=98=E1=9F=92=E1=9E=84=E1=9E=B6=E1=9E=99 -Name[ko]=3D=EC=9B=90=EA=B2=A9 =ED=8C=8C=EC=9D=BC=EC=97=90 =EC=A0=80=EC=9E= =A5=ED=95=9C =EC=95=8C=EB=9E=8C -Name[lt]=3DPriminimai nutolusiame faile -Name[lv]=3DAtg=C4=81din=C4=81jumi att=C4=81lin=C4=81t=C4=81 fail=C4=81 -Name[mr]=3D=E0=A4=A6=E0=A5=82=E0=A4=B0=E0=A4=B8=E0=A5=8D=E0=A4=A5 =E0=A4= =AB=E0=A4=BE=E0=A4=88=E0=A4=B2=E0=A5=80=E0=A4=A4=E0=A5=80=E0=A4=B2 =E0=A4= =8F=E0=A4=B2=E0=A4=BE=E0=A4=B0=E0=A5=8D=E0=A4=AE=E0=A5=8D=E0=A4=B8 -Name[nb]=3DVarslinger i fil p=C3=A5 nettverk -Name[nds]=3DAlarms binnen feern Datei -Name[ne]=3D=E0=A4=9F=E0=A4=BE=E0=A4=A2=E0=A4=BE=E0=A4=95=E0=A5=8B =E0=A4= =AB=E0=A4=BE=E0=A4=87=E0=A4=B2=E0=A4=AE=E0=A4=BE =E0=A4=B8=E0=A4=82=E0=A4= =B8=E0=A5=82=E0=A4=9A=E0=A4=95 -Name[nl]=3DHerinneringen in extern bestand -Name[nn]=3DAlarmar i ekstern fil -Name[pa]=3D=E0=A8=B0=E0=A8=BF=E0=A8=AE=E0=A9=8B=E0=A8=9F =E0=A8=AB=E0=A8= =BE=E0=A8=87=E0=A8=B2 =E0=A8=B5=E0=A8=BF=E0=A9=B1=E0=A8=9A =E0=A8=85=E0=A8= =B2=E0=A8=BE=E0=A8=B0=E0=A8=AE -Name[pl]=3DAlarmy w pliku zdalnym -Name[pt]=3DAlarmes num Ficheiro Remoto -Name[pt_BR]=3DAlarmes em arquivo remoto -Name[ro]=3DAlarme =C3=AEn fi=C8=99ier distant -Name[ru]=3D=D0=9D=D0=B0=D0=BF=D0=BE=D0=BC=D0=B8=D0=BD=D0=B0=D0=BD=D0=B8=D1= =8F =D0=B2 =D1=81=D0=B5=D1=82=D0=B5=D0=B2=D0=BE=D0=BC =D1=84=D0=B0=D0=B9=D0= =BB=D0=B5 -Name[sk]=3DAlarmy vo vzdialenom s=C3=BAbore -Name[sl]=3DAlarmi v oddaljeni datoteki -Name[sr]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 =D1=83 =D1=83=D0=B4=D0=B0= =D1=99=D0=B5=D0=BD=D0=BE=D0=BC =D1=84=D0=B0=D1=98=D0=BB=D1=83 -Name[sr@ijekavian]=3D=D0=90=D0=BB=D0=B0=D1=80=D0=BC=D0=B8 =D1=83 =D1=83=D0= =B4=D0=B0=D1=99=D0=B5=D0=BD=D0=BE=D0=BC =D1=84=D0=B0=D1=98=D0=BB=D1=83 -Name[sr@ijekavianlatin]=3DAlarmi u udaljenom fajlu -Name[sr@latin]=3DAlarmi u udaljenom fajlu -Name[sv]=3DAlarm i fj=C3=A4rrfil -Name[tr]=3DUzak Dosyadaki Alarmlar -Name[uk]=3D=D0=9D=D0=B0=D0=B3=D0=B0=D0=B4=D1=83=D0=B2=D0=B0=D0=BD=D0=BD=D1= =8F =D1=83 =D0=B2=D1=96=D0=B4=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=BE=D0=BC=D1= =83 =D1=84=D0=B0=D0=B9=D0=BB=D1=96 -Name[wa]=3DXh=C3=AEletes e-n on fitch=C3=AE d=C3=A5 lon -Name[x-test]=3DxxAlarms in Remote Filexx -Name[zh_CN]=3D=E8=BF=9C=E7=A8=8B=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9A=84=E6=8F= =90=E9=86=92=E4=BA=8B=E9=A1=B9 -Name[zh_TW]=3D=E9=81=A0=E7=AB=AF=E6=AA=94=E6=A1=88=E7=9A=84=E9=AC=A7=E9=90= =98 -Comment=3DProvides access to an alarm calendar in a remote file using KDE'= s network framework KIO -Comment[ar]=3D=D9=8A=D9=88=D9=81=D8=B1 =D9=88=D8=B5=D9=88=D9=84 =D9=84=D9= =85=D9=86=D8=A8=D9=87 =D8=A7=D9=84=D8=AA=D9=82=D9=88=D9=8A=D9=85 =D9=81=D9= =8A =D9=85=D9=84=D9=81 =D8=A8=D8=B9=D9=8A=D8=AF =D8=A8=D8=A5=D8=B3=D8=AA=D8= =AE=D8=AF=D8=A7=D9=85 =D8=A5=D8=B7=D8=A7=D8=B1 =D8=B4=D8=A8=D9=83=D8=A9 =D9= =83=D8=AF=D9=8A KIO -Comment[bs]=3DObezbje=C4=91uje pristup alarm kalendaru u udaljenoj datotec= i koriste=C4=87i KDE-ov mre=C5=BEni okvir KIO -Comment[ca]=3DProporciona acc=C3=A9s a un calendari d'alarmes en un fitxer= remot usant la infraestructura KIO de xarxa del KDE -Comment[ca@valencia]=3DProporciona l'acc=C3=A9s a un calendari d'alarmes e= n un fitxer remot usant la infraestructura KIO de xarxa del KDE -Comment[da]=3DGiver adgang til en alarm-kalender i en ekstern fil der brug= er KDE's netv=C3=A6rks-framework KIO -Comment[de]=3DErm=C3=B6glicht den Zugriff auf einen entfernten Erinnerunge= n-Kalender =C3=BCber KDEs Netzwerk-Zugriffsystem KIO. -Comment[el]=3D=CE=A0=CF=81=CE=BF=CF=83=CF=86=CE=AD=CF=81=CE=B5=CE=B9 =CF= =80=CF=81=CF=8C=CF=83=CE=B2=CE=B1=CF=83=CE=B7 =CE=B7=CE=BC=CE=B5=CF=81=CE= =BF=CE=BB=CE=BF=CE=B3=CE=AF=CE=BF=CF=85 =CE=B5=CE=B9=CE=B4=CE=BF=CF=80=CE= =BF=CE=B9=CE=AE=CF=83=CE=B5=CF=89=CE=BD =CF=83=CE=B5 =CE=AD=CE=BD=CE=B1 =CE= =B1=CF=80=CE=BF=CE=BC=CE=B1=CE=BA=CF=81=CF=85=CF=83=CE=BC=CE=AD=CE=BD=CE=BF= =CE=B1=CF=81=CF=87=CE=B5=CE=AF=CE=BF=CF=85 =CE=BC=CE=B5 =CF=84=CE=B7 =CF= =87=CF=81=CE=AE=CF=83=CE=B7 =CF=84=CE=BF=CF=85 =CF=83=CF=85=CF=83=CF=84=CE= =AE=CE=BC=CE=B1=CF=84=CE=BF=CF=82 KIO =CF=84=CE=BF=CF=85 KDE -Comment[en_GB]=3DProvides access to an alarm calendar in a remote file usi= ng KDE's network framework KIO -Comment[es]=3DProvee acceso a un calendario de alarmas en un archivo remot= o utilizando la infraestructura KIO de red de KDE -Comment[et]=3DV=C3=B5imaldab kasutada v=C3=B5rgufailis leiduvat h=C3=A4ire= te kalendrit KDE v=C3=B5rguraamistiku KIO vahendusel -Comment[fi]=3DTarjoaa p=C3=A4=C3=A4syn et=C3=A4tiedostoon tallennettuun h= =C3=A4lytyskalenteriin k=C3=A4ytt=C3=A4en KDE:n verkkorajapintaa (KIO) -Comment[fr]=3DFournit l'acc=C3=A8s aux alarmes de calendrier stock=C3=A9es= dans un fichier distant en utilisant les composants r=C3=A9seaux KIO de KDE -Comment[gl]=3DPermite acceder a un calendario de alarmas dun ficheiro remo= to empregando a infraestrutura de rede KIO do KDE -Comment[hu]=3DT=C3=A1voli f=C3=A1jlban t=C3=A1rolt eml=C3=A9keztet=C5=91kh= =C3=B6z biztos=C3=ADt hozz=C3=A1f=C3=A9r=C3=A9st a KIO keretrendszer seg=C3= =ADts=C3=A9g=C3=A9vel -Comment[ia]=3DForni accesso a un calendario de alarma in un file remote u= sante le schema de rete de KDE KIO -Comment[it]=3DConsente l'accesso ad un calendario di avvisi memorizzati su= un file remoto tramite l'infrastruttura di rete KIO di KDE -Comment[ja]=3DKDE =E3=81=AE=E3=83=8D=E3=83=83=E3=83=88=E3=83=AF=E3=83=BC= =E3=82=AF=E3=83=95=E3=83=AC=E3=83=BC=E3=83=A0=E3=83=AF=E3=83=BC=E3=82=AF KI= O =E3=82=92=E4=BD=BF=E3=81=A3=E3=81=A6=E3=80=81=E3=83=AA=E3=83=A2=E3=83=BC= =E3=83=88=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E4=BF=9D=E5=AD=98=E3= =81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=82=A2=E3=83=A9=E3=83=BC=E3=83= =A0=E3=82=AB=E3=83=AC=E3=83=B3=E3=83=80=E3=83=BC=E3=81=B8=E3=81=AE=E3=82=A2= =E3=82=AF=E3=82=BB=E3=82=B9=E3=82=92=E6=8F=90=E4=BE=9B=E3=81=97=E3=81=BE=E3= =81=99 -Comment[kk]=3D=D2=9A=D0=B0=D1=88=D1=8B=D2=9B=D1=82=D0=B0=D2=93=D1=8B =D1= =84=D0=B0=D0=B9=D0=BB=D0=B4=D0=B0=D2=93=D1=8B =D0=B5=D1=81=D0=BA=D0=B5=D1= =80=D1=82=D1=83=D0=BB=D0=B5=D1=80 =D0=BA=D2=AF=D0=BD=D1=82=D1=96=D0=B7=D0= =B1=D0=B5=D0=B3=D0=B5, KDE-=D0=BD=D1=96=D2=A3 KIO =D0=B6=D0=B5=D0=BB=D1=96 = =D2=9B=D2=B1=D1=80=D1=8B=D0=BB=D1=8B=D0=BC=D1=8B=D0=BD=D1=8B=D2=A3 =D0=BA= =D3=A9=D0=BC=D0=B5=D0=B3=D1=96=D0=BC=D0=B5=D0=BD =D2=9B=D0=B0=D1=82=D1=8B= =D0=BD=D0=B0=D1=83 -Comment[km]=3D=E1=9E=95=E1=9F=92=E1=9E=8A=E1=9E=9B=E1=9F=8B=E2=80=8B=E1=9E= =9F=E1=9E=B7=E1=9E=91=E1=9F=92=E1=9E=92=E1=9E=B7=E2=80=8B=E1=9E=85=E1=9E=BC= =E1=9E=9B=E2=80=8B=E1=9E=8A=E1=9F=86=E1=9E=8E=E1=9E=BE=E1=9E=9A=E1=9E=80=E1= =9E=B6=E1=9E=9A=E2=80=8B=E1=9E=91=E1=9F=85=E1=9E=80=E1=9E=B6=E1=9E=93=E1=9F= =8B=E2=80=8B=E1=9E=94=E1=9F=92=E1=9E=9A=E1=9E=8F=E1=9E=B7=E1=9E=91=E1=9E=B7= =E1=9E=93=E2=80=8B=E1=9E=87=E1=9E=BC=E1=9E=93=E2=80=8B=E1=9E=8A=E1=9F=86=E1= =9E=8E=E1=9E=B9=E1=9E=84=E2=80=8B=E1=9E=93=E1=9F=85=E2=80=8B=E1=9E=80=E1=9F= =92=E1=9E=93=E1=9E=BB=E1=9E=84=E2=80=8B=E1=9E=AF=E1=9E=80=E1=9E=9F=E1=9E=B6= =E1=9E=9A=E2=80=8B=E1=9E=96=E1=9E=B8=E2=80=8B=E1=9E=85=E1=9E=98=E1=9F=92=E1= =9E=84=E1=9E=B6=E1=9E=99=E2=80=8B=E1=9E=8A=E1=9F=84=E1=9E=99=E1=9E=94=E1=9F= =92=E1=9E=9A=E1=9E=BE=E2=80=8B=E1=9E=82=E1=9F=92=E1=9E=9A=E1=9F=84=E1=9E=84= =E1=9E=80=E1=9E=B6=E1=9E=9A=E1=9E=8E=E1=9F=8D=E2=80=8B=E1=9E=94=E1=9E=8E=E1= =9F=92=E1=9E=8A=E1=9E=B6=E1=9E=89 KIO =E2=80=8B=E1=9E=9A=E1=9E=94=E1=9E=9F= =E1=9F=8B KDE -Comment[ko]=3DKIO=EB=A5=BC =EC=82=AC=EC=9A=A9=ED=95=B4=EC=84=9C =EC=9B=90= =EA=B2=A9 =ED=8C=8C=EC=9D=BC=EC=9D=98 =EC=95=8C=EB=9E=8C =EB=8B=AC=EB=A0=A5= =EC=97=90 =EC=A0=91=EA=B7=BC=ED=95=A9=EB=8B=88=EB=8B=A4 -Comment[lt]=3DSuteikia prieig=C4=85 prie priminim=C5=B3 kalendoriaus nutol= usiame faile naudojant KDE tinklo aplinkos KIO -Comment[lv]=3DNodro=C5=A1ina piek=C4=BCuvi atg=C4=81din=C4=81jumu kalend= =C4=81ram, kas glab=C4=81jas vien=C4=81 att=C4=81lin=C4=81t=C4=81 fail=C4= =81, izmantojot KDE t=C4=ABkla ietvaru KIO -Comment[nb]=3DGir tilgang til en varslingskalender i en fil p=C3=A5 nettve= rket, ved bruk av KDEs rammeverk KIO for nettverk -Comment[nds]=3DStellt mit dat In-/Utgaavmoduul vun KDE sien Nettwark-Rahme= nwerk Togriep op en binnen en feern Datei wohrten Alarm-Kalenner praat. -Comment[nl]=3DGeeft toegang naar een herinneringagenda in een extern besta= nd gebruikmakend van KIO, een netwerkonderdeel van KDE -Comment[nn]=3DGjev tilgang til alarmkalendrar lagra i ei ekstern fil ved b= ruk av nettverksrammeverket KIO -Comment[pl]=3DZapewnia dost=C4=99p do kalendarza alarm=C3=B3w w pliku zdal= nymp przy pomocy systemu sieciowego KDE - KIO -Comment[pt]=3DOferece o acesso a um calend=C3=A1rio de alarmes num ficheir= o remoto, usando um KIO da plataforma de rede do KDE -Comment[pt_BR]=3DFornece acesso a um calend=C3=A1rio de alarmes em um arqu= ivo remoto usando o KIO framework da rede do KDE -Comment[ro]=3DOfer=C4=83 acces la un calendar de alarme stocat =C3=AEntr-u= n fi=C8=99ier distant, folosind infrastructura de re=C8=9Bea KIO din KDE -Comment[ru]=3D=D0=A5=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5 =D0=BD=D0= =B0=D0=BF=D0=BE=D0=BC=D0=B8=D0=BD=D0=B0=D0=BD=D0=B8=D0=B9 =D0=B2 =D1=81=D0= =B5=D1=82=D0=B5=D0=B2=D0=BE=D0=BC =D1=84=D0=B0=D0=B9=D0=BB=D0=B5, =D0=B4=D0= =BE=D1=81=D1=82=D1=83=D0=BF=D0=BD=D0=BE=D0=BC =D0=BF=D0=BE =D0=BF=D1=80=D0= =BE=D1=82=D0=BE=D0=BA=D0=BE=D0=BB=D1=83 KIO -Comment[sk]=3DUmo=C5=BE=C5=88uje pr=C3=ADstup do kalend=C3=A1ra alarmov vo= vzdialenom s=C3=BAbore pou=C5=BEit=C3=ADm KDE sie=C5=A5ovej =C5=A1trukt=C3= =BAry KIO -Comment[sl]=3DZ uporabo KDE-jevega omre=C5=BEnega ogrodja KIO omogo=C4=8Da= dostop do koledarja z alarmi, ki je shranjen v oddaljeni datoteki -Comment[sr]=3D=D0=9E=D0=BC=D0=BE=D0=B3=D1=83=D1=9B=D0=B0=D0=B2=D0=B0 =D0= =BF=D1=80=D0=B8=D1=81=D1=82=D1=83=D0=BF =D0=B0=D0=BB=D0=B0=D1=80=D0=BC=D0= =BD=D0=BE=D0=BC =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80=D1=83 =D1= =83 =D1=83=D0=B4=D0=B0=D1=99=D0=B5=D0=BD=D0=BE=D0=BC =D1=84=D0=B0=D1=98=D0= =BB=D1=83 =D0=BF=D0=BE=D0=BC=D0=BE=D1=9B=D1=83 =D0=9A=D0=94=D0=95=E2=80=91= =D0=BE=D0=B2=D0=BE=D0=B3 =D0=BC=D1=80=D0=B5=D0=B6=D0=BD=D0=BE=D0=B3 =D1=80= =D0=B0=D0=B4=D0=BD=D0=BE=D0=B3 =D0=BE=D0=BA=D0=B2=D0=B8=D1=80=D0=B0 =D0=9A= =E2=80=91=D0=A3/=D0=98 -Comment[sr@ijekavian]=3D=D0=9E=D0=BC=D0=BE=D0=B3=D1=83=D1=9B=D0=B0=D0=B2= =D0=B0 =D0=BF=D1=80=D0=B8=D1=81=D1=82=D1=83=D0=BF =D0=B0=D0=BB=D0=B0=D1=80= =D0=BC=D0=BD=D0=BE=D0=BC =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80= =D1=83 =D1=83 =D1=83=D0=B4=D0=B0=D1=99=D0=B5=D0=BD=D0=BE=D0=BC =D1=84=D0=B0= =D1=98=D0=BB=D1=83 =D0=BF=D0=BE=D0=BC=D0=BE=D1=9B=D1=83 =D0=9A=D0=94=D0=95= =E2=80=91=D0=BE=D0=B2=D0=BE=D0=B3 =D0=BC=D1=80=D0=B5=D0=B6=D0=BD=D0=BE=D0= =B3 =D1=80=D0=B0=D0=B4=D0=BD=D0=BE=D0=B3 =D0=BE=D0=BA=D0=B2=D0=B8=D1=80=D0= =B0 =D0=9A=E2=80=91=D0=A3/=D0=98 -Comment[sr@ijekavianlatin]=3DOmogu=C4=87ava pristup alarmnom kalendaru u u= daljenom fajlu pomo=C4=87u KDE=E2=80=91ovog mre=C5=BEnog radnog okvira K=E2= =80=91U/I -Comment[sr@latin]=3DOmogu=C4=87ava pristup alarmnom kalendaru u udaljenom = fajlu pomo=C4=87u KDE=E2=80=91ovog mre=C5=BEnog radnog okvira K=E2=80=91U/I -Comment[sv]=3DGer tillg=C3=A5ng till en alarmkalender i en fj=C3=A4rrfil m= ed anv=C3=A4ndning av KDE:s I/O-ramverk -Comment[tr]=3DKDE'nin a=C4=9F =C3=A7at=C4=B1s=C4=B1 KIO'yu kullanarak uzak= bir dosyadaki bir alarm takvimine eri=C5=9Fim sa=C4=9Flar -Comment[uk]=3D=D0=9D=D0=B0=D0=B4=D0=B0=D1=94 =D0=B4=D0=BE=D1=81=D1=82=D1= =83=D0=BF =D0=B4=D0=BE =D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80=D1= =8F =D0=BD=D0=B0=D0=B3=D0=B0=D0=B4=D1=83=D0=B2=D0=B0=D0=BD=D1=8C, =D1=8F=D0= =BA=D0=B8=D0=B9 =D0=B7=D0=B1=D0=B5=D1=80=D1=96=D0=B3=D0=B0=D1=94=D1=82=D1= =8C=D1=81=D1=8F =D1=83 =D0=B2=D1=96=D0=B4=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0= =BE=D0=BC=D1=83 =D1=84=D0=B0=D0=B9=D0=BB=D1=96, =D0=B7=D0=B0 =D0=B4=D0=BE= =D0=BF=D0=BE=D0=BC=D0=BE=D0=B3=D0=BE=D1=8E =D0=BC=D0=B5=D1=80=D0=B5=D0=B6= =D0=B5=D0=B2=D0=B8=D1=85 =D0=B7=D0=B0=D1=81=D0=BE=D0=B1=D1=96=D0=B2 KIO KDE -Comment[wa]=3DDene l'=C2=A0acc=C3=A8s a on calindr=C3=AE di xh=C3=AEletes = dins on fitch=C3=AE d=C3=A5 lon tot-z s'=C2=A0siervant di l'=C2=A0evironmin= t KIO rantoele da KDE -Comment[x-test]=3DxxProvides access to an alarm calendar in a remote file = using KDE's network framework KIOxx -Comment[zh_CN]=3D=E9=80=9A=E8=BF=87 KDE =E7=BD=91=E7=BB=9C=E6=A1=86=E6=9E= =B6 KIO=EF=BC=8C=E6=8F=90=E4=BE=9B=E5=AF=B9=E5=AD=98=E5=82=A8=E5=9C=A8=E4= =B8=80=E4=B8=AA=E8=BF=9C=E7=A8=8B=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9A=84=E6=8F= =90=E9=86=92=E6=97=A5=E5=8E=86=E7=9A=84=E8=AE=BF=E9=97=AE=E6=94=AF=E6=8C=81 -Comment[zh_TW]=3D=E6=8F=90=E4=BE=9B=E5=AD=98=E5=8F=96=E4=BD=BF=E7=94=A8 KD= E =E7=B6=B2=E8=B7=AF=E6=9E=B6=E6=A7=8B KIO =E5=84=B2=E5=AD=98=E5=9C=A8=E9= =81=A0=E7=AB=AF=E6=AA=94=E6=A1=88=E4=B8=AD=E7=9A=84=E9=AC=A7=E9=90=98=E8=A1= =8C=E4=BA=8B=E6=9B=86=E7=9A=84=E5=8A=9F=E8=83=BD -X-KDE-Library=3Dkalarm_remote -Type=3DService -X-KDE-ServiceTypes=3DKResources/Plugin -X-KDE-ResourceFamily=3Dalarms -X-KDE-ResourceType=3Dremote diff --git a/kalarm/resources/resourcelocal.cpp b/kalarm/resources/resource= local.cpp deleted file mode 100644 index 3048795..0000000 --- a/kalarm/resources/resourcelocal.cpp +++ /dev/null @@ -1,272 +0,0 @@ -/* - * resourcelocal.cpp - KAlarm local calendar resource - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * Based on resourcelocal.cpp in libkcal (updated to rev 765072), - * Copyright (c) 1998 Preston Brown - * Copyright (c) 2001,2003 Cornelius Schumacher - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resourcelocal.moc" - -#include - -#include -#include -#include -#include - -#include - -using namespace KCal; - - -KAResourceLocal::KAResourceLocal() - : AlarmResource(), - mFileReadOnly(false) -{ - init(); -} - -KAResourceLocal::KAResourceLocal(const KConfigGroup& group) - : AlarmResource(group), - mFileReadOnly(false) -{ - mURL =3D KUrl(group.readPathEntry("CalendarURL", QString())); - init(); -} - -KAResourceLocal::KAResourceLocal(CalEvent::Type type, const QString& fileN= ame) - : AlarmResource(type), - mURL(KUrl::fromPath(fileName)), - mFileReadOnly(false) -{ - init(); -} - -void KAResourceLocal::init() -{ - setType("file"); // set resource type - - //setSavePolicy(SaveDelayed); // unnecessary for KAlarm, and would ov= erride base class setting - - connect(&mDirWatch, SIGNAL(dirty(QString)), SLOT(reload())); - connect(&mDirWatch, SIGNAL(created(QString)), SLOT(reload())); - connect(&mDirWatch, SIGNAL(deleted(QString)), SLOT(reload())); - - mDirWatch.addFile(mURL.toLocalFile()); - enableResource(isActive()); -} - -KAResourceLocal::~KAResourceLocal() -{ - mDirWatch.stopScan(); - if (isOpen()) - close(); -} - -void KAResourceLocal::writeConfig(KConfigGroup& group) -{ - group.writePathEntry("CalendarURL", mURL.prettyUrl()); - AlarmResource::writeConfig(group); -} - -void KAResourceLocal::startReconfig() -{ - mNewURL =3D mURL; - AlarmResource::startReconfig(); -} - -void KAResourceLocal::applyReconfig() -{ - if (mReconfiguring) - { - AlarmResource::applyReconfig(); - if (setFileName(mNewURL)) - mReconfiguring =3D 3; // indicate that location has changed - AlarmResource::applyReconfig(); - } -} - -bool KAResourceLocal::readOnly() const -{ - return mFileReadOnly || AlarmResource::readOnly(); -} - -void KAResourceLocal::enableResource(bool enable) -{ - kDebug(KARES_DEBUG) << enable << ":" << mURL.toLocalFile(); - if (enable) - { - lock(mURL.toLocalFile()); - mDirWatch.startScan(); - } - else - { - lock(QString()); - mDirWatch.stopScan(); - } -} - -bool KAResourceLocal::doLoad(bool) -{ - if (!KStandardDirs::exists(mURL.toLocalFile())) - { - kDebug(KARES_DEBUG) << "File doesn't exist yet."; - mLoaded =3D false; - emit invalidate(this); - calendar()->close(); - setWrongAlarmType(false, false); - clearChanges(); - updateCustomEvents(false); // calendar is now empty - if (!isActive()) - return false; - mLoading =3D true; - if (!doSave(true)) // save the empty calendar, to create the cal= endar file - { - mLoading =3D false; - return false; - } - mFileReadOnly =3D false; - setCompatibility(KACalendar::Current); - mLoading =3D false; - mLoaded =3D true; - setReloaded(true); // the resource has now been loaded at least = once - emit loaded(this); - return true; - } - return loadFile(); -} - -void KAResourceLocal::reload() -{ - kDebug(KARES_DEBUG) << mURL.toLocalFile(); - if (!isOpen()) - return; - if (mLastModified =3D=3D readLastModified()) - { - kDebug(KARES_DEBUG) << "File not modified since last read."; - QFileInfo fi(mURL.toLocalFile()); - mFileReadOnly =3D !fi.isWritable(); - return; - } - loadFile(); - emit resourceChanged(this); -} - -bool KAResourceLocal::loadFile() -{ - kDebug(KARES_DEBUG) << mURL.toLocalFile(); - mLoaded =3D false; - emit invalidate(this); - calendar()->close(); - setWrongAlarmType(false, false); - clearChanges(); - if (!isActive()) - { - updateCustomEvents(false); // calendar is now empty - return false; - } - mLoading =3D true; - disableChangeNotification(); - bool success =3D calendar()->load(mURL.toLocalFile()); - enableChangeNotification(); - if (!success) - { - mLoading =3D false; - updateCustomEvents(); - return false; - } - mLastModified =3D readLastModified(); - QFileInfo fi(mURL.toLocalFile()); - mFileReadOnly =3D !fi.isWritable(); - checkCompatibility(fileName()); - mLoading =3D false; - updateCustomEvents(); - mLoaded =3D true; - setReloaded(true); // the resource has now been loaded at least once - emit loaded(this); - return true; -} - -bool KAResourceLocal::doSave(bool) -{ - kDebug(KARES_DEBUG) << mURL.toLocalFile(); - if (mCalIDFunction) - (*mCalIDFunction)(*calendar()); // write the application ID int= o the calendar - bool success =3D calendar()->save(mURL.toLocalFile()); - clearChanges(); - mLastModified =3D readLastModified(); - emit resourceSaved(this); - return success; -} - -QDateTime KAResourceLocal::readLastModified() -{ - QFileInfo fi(mURL.toLocalFile()); - return fi.lastModified(); -} - -QString KAResourceLocal::fileName() const -{ - return mURL.toLocalFile(); -} - -bool KAResourceLocal::setFileName(const KUrl& newURL) -{ - if (mReconfiguring =3D=3D 1) - { - mNewURL =3D newURL; - return true; - } - if ( !newURL.isLocalFile() || newURL.toLocalFile() =3D=3D mURL.toLocal= File() ) - return false; - kDebug(KARES_DEBUG) << newURL.toLocalFile(); - if (isOpen()) - close(); - bool active =3D isActive(); - if (active) - enableResource(false); - mDirWatch.removeFile(mURL.toLocalFile()); - mURL =3D newURL; - mDirWatch.addFile(mURL.toLocalFile()); - if (active) - enableResource(true); - // Trigger loading the new resource, and ensure that the new configura= tion is saved - emit locationChanged(this); - return true; -} - -bool KAResourceLocal::setLocation(const QString& fileName, const QString&) -{ - KUrl newURL =3D KUrl::fromPath(fileName); - return setFileName(newURL); -} - -QString KAResourceLocal::displayLocation() const -{ - return mURL.toLocalFile(); -} - -QString KAResourceLocal::displayType() const -{ - return i18nc("@info/plain", "File"); -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcelocal.h b/kalarm/resources/resourcelo= cal.h deleted file mode 100644 index e4e3456..0000000 --- a/kalarm/resources/resourcelocal.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * resourcelocal.h - KAlarm local calendar resource - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * Based on resourcelocal.h in libkcal, - * Copyright (c) 1998 Preston Brown - * Copyright (c) 2001,2003 Cornelius Schumacher - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef KARESOURCELOCAL_H -#define KARESOURCELOCAL_H - -/* @file resourcelocal.h - KAlarm local calendar resource */ - -#include "alarmresource.h" - -#include -#include - -#include - - -/** A KAlarm calendar resource stored as a local file. */ -class KALARM_RESOURCES_EXPORT KAResourceLocal : public AlarmResource -{ - Q_OBJECT - public: - KAResourceLocal(); - /** Create resource from configuration information stored in a KCo= nfig object. */ - explicit KAResourceLocal(const KConfigGroup&); - /** Create resource for file named @a fileName. */ - KAResourceLocal(CalEvent::Type, const QString& fileName); - virtual ~KAResourceLocal(); - - QString fileName() const; - bool setFileName(const KUrl&); - virtual QString displayType() const; - virtual QString displayLocation() const; - virtual QStringList location() const { return QStringList(fileNa= me()); } - virtual bool setLocation(const QString& fileName, const QSt= ring& =3D QString()); - virtual bool readOnly() const; - virtual void writeConfig(KConfigGroup&); - virtual void startReconfig(); - virtual void applyReconfig(); - - // Override unused virtual functions - virtual KCal::Todo::List rawTodos(KCal::TodoSortField =3D KCal::To= doSortUnsorted, KCal::SortDirection =3D KCal::SortDirectionAscending) { re= turn KCal::Todo::List(); } - virtual KCal::Journal::List rawJournals(KCal::JournalSortField =3D= KCal::JournalSortUnsorted, KCal::SortDirection =3D KCal::SortDirectionAsce= nding) { return KCal::Journal::List(); } - - protected: - virtual bool doLoad(bool syncCache); - virtual bool doSave(bool syncCache); - virtual bool doSave(bool syncCache, KCal::Incidence* i) { return = AlarmResource::doSave(syncCache, i); } - QDateTime readLastModified(); - virtual void enableResource(bool enable); - - protected slots: - void reload(); - - private: - void init(); - bool loadFile(); - // Inherited virtual methods which should not be used by derived c= lasses. - using ResourceCalendar::doLoad; - using ResourceCalendar::doSave; - - KUrl mURL; - KUrl mNewURL; // new file name to be applied by applyRec= onfig() - KDirWatch mDirWatch; - QDateTime mLastModified; - bool mFileReadOnly; // calendar file is a read-only file -}; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcelocal_plugin.cpp b/kalarm/resources/r= esourcelocal_plugin.cpp deleted file mode 100644 index ec8e95f..0000000 --- a/kalarm/resources/resourcelocal_plugin.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * resourcelocal_plugin.cpp - KAlarm local alarm calendar file resource= plugin - * Program: kalarm - * Copyright =C2=A9 2006 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resourcelocal.h" -#include "resourcelocalwidget.h" - -#include -#include - -extern "C" -{ - KDE_EXPORT void* init_kalarm_local() - { -#ifndef KALARM_STANDALONE - KGlobal::locale()->insertCatalog("libkcal"); -#endif - return new KRES::PluginFactory(); - } -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcelocaldir.cpp b/kalarm/resources/resou= rcelocaldir.cpp deleted file mode 100644 index 9c3b608..0000000 --- a/kalarm/resources/resourcelocaldir.cpp +++ /dev/null @@ -1,494 +0,0 @@ -/* - * resourcelocaldir.cpp - KAlarm local directory calendar resource - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * Based on resourcelocaldir.cpp in libkcal (updated to rev 779953,938673= ,938806), - * Copyright (c) 2003 Cornelius Schumacher - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resourcelocaldir.moc" - -#include -#include - -#include -#include -#include - -#include -#include -#include - -using namespace KCal; - -static QDateTime readLastModified(const QString& filePath); - - -KAResourceLocalDir::KAResourceLocalDir() - : AlarmResource(), - mDirReadOnly(false) -{ - init(); -} - -KAResourceLocalDir::KAResourceLocalDir(const KConfigGroup& group) - : AlarmResource(group), - mDirReadOnly(false) -{ - mURL =3D KUrl(group.readPathEntry("CalendarURL", QString())); - init(); -} - -KAResourceLocalDir::KAResourceLocalDir(CalEvent::Type type, const QString&= dirName) - : AlarmResource(type), - mURL(KUrl::fromPath(dirName)), - mDirReadOnly(false) -{ - init(); -} - -void KAResourceLocalDir::init() -{ - setType("dir"); // set resource type - - //setSavePolicy(SaveDelayed); // unnecessary for KAlarm, and would ov= erride base class setting - - connect(&mDirWatch, SIGNAL(dirty(QString)), SLOT(slotUpdated(QString))= ); - connect(&mDirWatch, SIGNAL(created(QString)), SLOT(slotUpdated(QString= ))); - connect(&mDirWatch, SIGNAL(deleted(QString)), SLOT(slotUpdated(QString= ))); - mDirWatch.addDir(mURL.toLocalFile(), KDirWatch::WatchFiles); - - enableResource(isActive()); - - // Initially load all files in the directory, then just load changes - setReloadPolicy(ReloadOnStartup); -} - -KAResourceLocalDir::~KAResourceLocalDir() -{ - mDirWatch.stopScan(); - if (isOpen()) - close(); -} - -void KAResourceLocalDir::writeConfig(KConfigGroup& group) -{ - group.writePathEntry("CalendarURL", mURL.prettyUrl()); - AlarmResource::writeConfig(group); -} - -void KAResourceLocalDir::startReconfig() -{ - mNewURL =3D mURL; - AlarmResource::startReconfig(); -} - -void KAResourceLocalDir::applyReconfig() -{ - if (mReconfiguring) - { - AlarmResource::applyReconfig(); - if (setDirName(mNewURL)) - mReconfiguring =3D 3; // indicate that location has changed - AlarmResource::applyReconfig(); - } -} - -bool KAResourceLocalDir::readOnly() const -{ - return mDirReadOnly || AlarmResource::readOnly(); -} - -void KAResourceLocalDir::setReadOnly(bool ro) -{ - // Re-evaluate the directory's read-only status (since KDirWatch - // doesn't pick up permissions changes on the directory itself). - QFileInfo dirInfo(mURL.toLocalFile()); - mDirReadOnly =3D !dirInfo.isWritable(); - AlarmResource::setReadOnly(ro); -} - -void KAResourceLocalDir::enableResource(bool enable) -{ - kDebug(KARES_DEBUG) << enable << ":" << mURL.toLocalFile(); - if (enable) - { - lock(mURL.toLocalFile()); - mDirWatch.startScan(); - } - else - { - lock(QString()); - mDirWatch.stopScan(); - } -} - -bool KAResourceLocalDir::doOpen() -{ - QFileInfo dirInfo(mURL.toLocalFile()); - return dirInfo.isDir() && dirInfo.isReadable(); -} - -void KAResourceLocalDir::slotUpdated(const QString& filepath) -{ -#ifdef __GNUC__ -#warning Only reload the individual file which has changed -#endif - if (filepath.contains(QRegExp("(~|\\.new|\\.tmp)$")) - || filepath.startsWith(mURL.toLocalFile() + "/qt_temp.")) - return; // ignore backup or temporary file - doLoad(false); -} -/*************************************************************************= ***** -* Load the files in the local directory, and add their events to our calen= dar. -* If 'syncCache' is true, all files are loaded; if false, only changed fil= es -* are loaded. -* Events which contain no alarms are ignored.. -* Reply =3D true if any file in the directory was loaded successfully. -*/ -bool KAResourceLocalDir::doLoad(bool syncCache) -{ - kDebug(KARES_DEBUG) << mURL.toLocalFile() << (syncCache ?": load all" = :": load changes only"); - if (!isActive() || !isOpen()) - return false; - ModifiedMap oldLastModified; - CompatibilityMap oldCompatibilityMap; - Incidence::List changes; - mLoading =3D true; - mLoaded =3D false; - disableChangeNotification(); - setCompatibility(KACalendar::ByEvent); - if (syncCache) - { - emit invalidate(this); - calendar()->close(); - setWrongAlarmType(false, false); - clearChanges(); - } - else - { -emit invalidate(this); // necessary until load changes only is fixed - oldLastModified =3D mLastModified; - oldCompatibilityMap =3D mCompatibilityMap; - changes =3D changedIncidences(); - } - mLastModified.clear(); - mCompatibilityMap.clear(); - QString dirName =3D mURL.toLocalFile(); - bool success =3D false; - bool foundFile =3D false; - if (KStandardDirs::exists(dirName) || KStandardDirs::exists(dirName = + '/')) - { - kDebug(KARES_DEBUG) << "Opening" << dirName; - FixFunc prompt =3D PROMPT_PART; - QFileInfo dirInfo(dirName); - if (!(dirInfo.isDir() && dirInfo.isReadable())) - { - setWrongAlarmType(false, false); - return false; - } - mDirReadOnly =3D !dirInfo.isWritable(); - QDir dir(dirName, QString(), QDir::Unsorted, QDir::Files | QDir::R= eadable); - QStringList entries =3D dir.entryList(QDir::Files | QDir::Readable= ); - QStringList writable =3D dir.entryList(QDir::Files | QDir::Writabl= e); - for (int i =3D 0, end =3D entries.count(); i < end; ++i) - { - // Check the next file in the directory - QString id =3D entries[i]; - if (id.contains(QRegExp("(~|\\.new|\\.tmp)$")) - || id.startsWith(QLatin1String("qt_temp."))) - continue; // ignore backup or temporary file - QString fileName =3D dirName + '/' + id; - foundFile =3D true; - - if (!syncCache) - { - // Only load new or changed events -#ifdef __GNUC__ -#warning All events are actually loaded, not just new or changed -#endif - clearChange(id); - Event* ev =3D calendar()->event(id); - if (ev && changes.indexOf(ev) < 0) - { - ModifiedMap::ConstIterator mit =3D oldLastModified.con= stFind(id); - if (mit !=3D oldLastModified.constEnd() && mit.value= () =3D=3D readLastModified(fileName)) - { - // The file hasn't changed, and its event is uncha= nged - // in our calendar, so just transfer the event to = the - // new maps without rereading the file. - mCompatibilityMap[ev] =3D oldCompatibilityMap[ev]; - mLastModified[id] =3D mit.value(); - success =3D true; - continue; - } - } - // It's either a new file, or it has changed - if (ev) - calendar()->deleteEvent(ev); - } - // Load the file and check whether it's the current KAlarm for= mat. - // If not, only prompt the user once whether to convert it. - if (loadFile(fileName, id, !writable.contains(id), prompt)) - success =3D true; - } - if (!foundFile) - success =3D true; // don't return error if there are no fil= es - } - else if (syncCache) - { - kDebug(KARES_DEBUG) << "Creating" << dirName; - - // Create the directory. Use 0775 to allow group-writable if the u= mask - // allows it (permissions will be 0775 & ~umask). This is desired = e.g. for - // group-shared directories! - success =3D KStandardDirs::makeDir(dirName, 0775); - mDirReadOnly =3D false; - } - - if (!syncCache) - { - if (mLastModified.isEmpty()) - { - emit invalidate(this); - calendar()->close(); - setWrongAlarmType(false, false); - } - else - { - // Delete any events in the calendar for which files were not = found - Event::List oldEvents =3D calendar()->rawEvents(); - for (int i =3D 0, end =3D oldEvents.count(); i < end; ++i) - { - if (!mCompatibilityMap.contains(oldEvents[i])) - calendar()->deleteEvent(oldEvents[i]); - } - } - } - - setWrongAlarmType(!checkAlarmTypes(*calendar())); // check if it con= tains only wrong alarm types - - mLoading =3D false; - enableChangeNotification(); - updateCustomEvents(); - if (success) - { - mLoaded =3D true; - setReloaded(true); // the resource has now been loaded at least = once - emit loaded(this); - if (!syncCache) - emit resourceChanged(this); - } - return success; -} - -/*************************************************************************= ***** -* Load one file from the local directory, and return its event in 'event'. -* Any event whose ID is not the same as the file name, or any event not -* containing alarms, is ignored. -* Reply =3D true if the calendar loaded successfully (even if empty). -*/ -bool KAResourceLocalDir::loadFile(const QString& fileName, const QString& = id, bool readOnly, FixFunc& prompt) -{ - bool success =3D false; - CalendarLocal calendar(this->calendar()->timeSpec()); - if (!calendar.load(fileName)) - { - // Loading this file failed, but just assume that it's not a calen= dar file - kDebug(KARES_DEBUG) << fileName << "failed"; - } - else - { - KACalendar::Compat compat =3D checkCompatibility(calendar, fileNam= e, prompt); - switch (compat) - { - case KACalendar::Converted: // user elected to convert. Don'= t prompt again. - prompt =3D CONVERT; - compat =3D KACalendar::Current; - break; - case KACalendar::Convertible: // user elected not to convert. = Don't prompt again. - prompt =3D NO_CONVERT; - break; - case KACalendar::Current: - case KACalendar::Incompatible: - case KACalendar::ByEvent: - break; - } - kDebug(KARES_DEBUG) << fileName << ": compatibility=3D" << compat; - Event::List rawEvents =3D calendar.rawEvents(); - for (int i =3D 0, end =3D rawEvents.count(); i < end; ++i) - { - Event* ev =3D rawEvents[i]; - if (ev->uid() !=3D id) - { - kError(KARES_DEBUG) << "Wrong event ID (" << ev->uid(); - continue; // ignore any event with the wrong ID - it sh= ouldn't be there! - } - Alarm::List alarms =3D ev->alarms(); - if (!alarms.isEmpty()) - { - Event* event =3D ev->clone(); - if (readOnly) - event->setReadOnly(true); - this->calendar()->addEvent(event); - mCompatibilityMap[event] =3D compat; - } - } - success =3D true; // at least one file has been opened success= fully - } - mLastModified[id] =3D readLastModified(fileName); - return success; -} - -bool KAResourceLocalDir::doSave(bool) -{ - kDebug(KARES_DEBUG) << mURL.toLocalFile(); - bool success =3D true; - Incidence::List list =3D addedIncidences(); - list +=3D changedIncidences(); - qSort(list); - Incidence* last =3D 0; - for (int i =3D 0, end =3D list.count(); i < end; ++i) - { - if (list[i] !=3D last) - { - last =3D list[i]; - if (!doSave(true, last)) - success =3D false; - } - } - emit resourceSaved(this); - return success; -} - -bool KAResourceLocalDir::doSave(bool, Incidence* incidence) -{ - if (mDeletedIncidences.contains(incidence)) - { - mDeletedIncidences.removeAll(incidence); - return true; - } - - QString id =3D incidence->uid(); - QString fileName =3D mURL.toLocalFile() + '/' + id; - kDebug(KARES_DEBUG) << fileName; - - CalendarLocal cal(calendar()->timeSpec()); - cal.setCustomProperties(calendar()->customProperties()); // copy all= VCALENDAR custom properties to each file - if (mCalIDFunction) - (*mCalIDFunction)(cal); // write the appl= ication ID into the calendar - bool success =3D cal.addIncidence(incidence->clone()); - if (success) - { - mDirWatch.stopScan(); // prohibit the dirty() signal and a follow= ing reload - success =3D cal.save(fileName); - mDirWatch.startScan(); - clearChange(id); - mLastModified[id] =3D readLastModified(fileName); - } - return success; -} - -bool KAResourceLocalDir::addEvent(Event* event) -{ - if (!AlarmResource::addEvent(event)) - return false; - mCompatibilityMap[event] =3D KACalendar::Current; - return true; -} - -bool KAResourceLocalDir::deleteEvent(Event* event) -{ - kDebug(KARES_DEBUG); - if (!deleteIncidenceFile(event)) - return false; - // Remove event from added/changed lists, to avoid it being recreated = in doSave() - clearChange(event); - disableChangeNotification(); // don't record this deletion as pendi= ng - bool success =3D calendar()->deleteEvent(event); - if (success) - mDeletedIncidences.append(event); - enableChangeNotification(); - return success; -} - -bool KAResourceLocalDir::deleteIncidenceFile(Incidence* incidence) -{ - QFile file(mURL.toLocalFile() + '/' + incidence->uid()); - if (!file.exists()) - return true; - mDirWatch.stopScan(); - bool removed =3D file.remove(); - mDirWatch.startScan(); - return removed; -} - -QString KAResourceLocalDir::dirName() const -{ - return mURL.toLocalFile(); -} - -bool KAResourceLocalDir::setDirName(const KUrl& newURL) -{ - if (mReconfiguring =3D=3D 1) - { - mNewURL =3D newURL; - return true; - } - if (!newURL.isLocalFile() || newURL.toLocalFile() =3D=3D mURL.toLocalF= ile()) - return false; - kDebug(KARES_DEBUG) << newURL.toLocalFile(); - if (isOpen()) - close(); - bool active =3D isActive(); - if (active) - enableResource(false); - mDirWatch.removeDir(mURL.toLocalFile()); - mURL =3D newURL; - mDirWatch.addDir(mURL.toLocalFile(), KDirWatch::WatchFiles); - if (active) - enableResource(true); - // Trigger loading the new resource, and ensure that the new configura= tion is saved - emit locationChanged(this); - return true; -} - -bool KAResourceLocalDir::setLocation(const QString& dirName, const QString= &) -{ - KUrl newURL =3D KUrl::fromPath(dirName); - return setDirName(newURL); -} - -QString KAResourceLocalDir::displayLocation() const -{ - return mURL.toLocalFile(); -} - -QString KAResourceLocalDir::displayType() const -{ - return i18nc("@info/plain Directory in filesystem", "Directory"); -} - -QDateTime readLastModified(const QString& filePath) -{ - QFileInfo fi(filePath); - return fi.lastModified(); -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcelocaldir.h b/kalarm/resources/resourc= elocaldir.h deleted file mode 100644 index 683d5ef..0000000 --- a/kalarm/resources/resourcelocaldir.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * resourcelocaldir.h - KAlarm local directory alarm calendar resource - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * Based on resourcelocaldir.h in libkcal, - * Copyright (c) 2003 Cornelius Schumacher - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef RESOURCELOCALDIR_H -#define RESOURCELOCALDIR_H - -/* @file resourcelocaldir.h - KAlarm local directory alarm calendar resour= ce */ - -#include "alarmresource.h" - -#include -#include -#include -#include - -namespace KCal { - class Incidence; -} - - -/** A KAlarm calendar resource stored in a directory as one file per alarm= . */ -class KALARM_RESOURCES_EXPORT KAResourceLocalDir : public AlarmResource -{ - Q_OBJECT - public: - KAResourceLocalDir(); - /** Create resource from configuration information stored in a KCo= nfig object. */ - explicit KAResourceLocalDir(const KConfigGroup&); - /** Create resource for directory named @p dirName. */ - KAResourceLocalDir(CalEvent::Type, const QString& dirName); - virtual ~KAResourceLocalDir(); - - const KUrl& url() const { return mURL; } - QString dirName() const; - bool setDirName(const KUrl&); - virtual QString displayType() const; - virtual QString displayLocation() const; - virtual QStringList location() const { return QStringList(dirNam= e()); } - virtual bool setLocation(const QString& dirName, const QStr= ing& =3D QString()); - virtual bool readOnly() const; - virtual void setReadOnly(bool); - virtual bool addEvent(KCal::Event*); - virtual bool deleteEvent(KCal::Event*); - virtual void writeConfig(KConfigGroup&); - virtual void startReconfig(); - virtual void applyReconfig(); - - // Override unused virtual functions - virtual KCal::Todo::List rawTodos(KCal::TodoSortField =3D KCal::To= doSortUnsorted, KCal::SortDirection =3D KCal::SortDirectionAscending) { re= turn KCal::Todo::List(); } - virtual KCal::Journal::List rawJournals(KCal::JournalSortField =3D= KCal::JournalSortUnsorted, KCal::SortDirection =3D KCal::SortDirectionAsce= nding) { return KCal::Journal::List(); } - - protected: - virtual bool doOpen(); - /** Load the resource. If 'syncCache' is true, all files in the di= rectory - * are reloaded. If 'syncCache' is false, only changed files are = reloaded. */ - virtual bool doLoad(bool syncCache); - - virtual bool doSave(bool syncCache); - bool doSave(bool syncCache, KCal::Incidence*); - virtual void enableResource(bool enable); - - private slots: - void slotUpdated(const QString& filepath); - - private: - void init(); - bool loadFile(const QString& fileName, const QString& id, = bool readOnly, FixFunc& prompt); - bool deleteIncidenceFile(KCal::Incidence *incidence); - // Inherited virtual methods which are not used by derived classes - using ResourceCalendar::doLoad; - virtual bool doSave() { return false; } - virtual bool doSave(KCal::Incidence*) { return false; } - - KUrl mURL; - KUrl mNewURL; // new directory to be applied by applyRec= onfig() - KDirWatch mDirWatch; - typedef QMap ModifiedMap; - ModifiedMap mLastModified; - QList mDeletedIncidences; - bool mDirReadOnly; // directory is read-only -}; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcelocaldir_plugin.cpp b/kalarm/resource= s/resourcelocaldir_plugin.cpp deleted file mode 100644 index f8a0105..0000000 --- a/kalarm/resources/resourcelocaldir_plugin.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * resourcelocaldir_plugin.cpp - KAlarm local directory alarm calendar = resource plugin - * Program: kalarm - * Copyright =C2=A9 2006 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resourcelocaldir.h" -#include "resourcelocaldirwidget.h" - -#include -#include - -extern "C" -{ - KDE_EXPORT void* init_kalarm_localdir() - { -#ifndef KALARM_STANDALONE - KGlobal::locale()->insertCatalog("libkcal"); -#endif - return new KRES::PluginFactory(); - } -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcelocaldirwidget.cpp b/kalarm/resources= /resourcelocaldirwidget.cpp deleted file mode 100644 index 608f3e8..0000000 --- a/kalarm/resources/resourcelocaldirwidget.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * resourcelocaldirwidget.cpp - configuration widget for local director= y calendar resource - * Program: kalarm - * Copyright =C2=A9 2006,2008,2010 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resourcelocaldir.h" -#include "resourcelocaldirwidget.moc" - -#include -#include -#include -#include - -#include -#include - - -ResourceLocalDirConfigWidget::ResourceLocalDirConfigWidget(QWidget* parent) - : ResourceConfigWidget(parent) -{ - QGridLayout* layout =3D new QGridLayout(this); - - QLabel* label =3D new QLabel(i18nc("@label:textbox", "Location:"), thi= s); - layout->addWidget(label, 1, 0); - mURL =3D new KUrlRequester(this); - mURL->setMode(KFile::Directory | KFile::LocalOnly); - layout->addWidget(mURL, 1, 1); -} - -void ResourceLocalDirConfigWidget::loadSettings(KRES::Resource* resource) -{ -// KAResourceLocalDir* res =3D dynamic_cast(resour= ce); - KAResourceLocalDir* res =3D static_cast(resource); - if (!res) - kError(KARES_DEBUG) << "KAResourceLocalDir: cast failed"; - else - { - ResourceConfigWidget::loadSettings(resource); - mURL->setUrl(res->dirName()); - kDebug(KARES_DEBUG) << "Directory" << mURL->url(); - } -} - -void ResourceLocalDirConfigWidget::saveSettings(KRES::Resource *resource) -{ -// KAResourceLocalDir* res =3D dynamic_cast(resour= ce); - KAResourceLocalDir* res =3D static_cast(resource); - if (!res) - kDebug(KARES_DEBUG) << "KAResourceLocalDir: cast failed"; - else - { - res->setDirName(mURL->url()); - if (mURL->url().isEmpty()) - { - KMessageBox::information(this, i18nc("@info", "No location spe= cified. The calendar will be invalid.")); - resource->setReadOnly(true); - } - } -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcelocaldirwidget.h b/kalarm/resources/r= esourcelocaldirwidget.h deleted file mode 100644 index 3edad27..0000000 --- a/kalarm/resources/resourcelocaldirwidget.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * resourcelocaldirwidget.h - configuration widget for a local director= y calendar resource - * Program: kalarm - * Copyright =C2=A9 2006 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef RESOURCELOCALDIRWIDGET_H -#define RESOURCELOCALDIRWIDGET_H - -/* @file resourcelocaldirwidget.h - configuration widget for a local direc= tory alarm calendar resource */ - -#include "resourcewidget.h" -#include "kalarm_resources_export.h" - -class KUrlRequester; - -/** - Configuration widget for local directory alarm calendar resource. - @see KAResourceLocalDir -*/ -class KALARM_RESOURCES_EXPORT ResourceLocalDirConfigWidget : public Resour= ceConfigWidget -{ - Q_OBJECT - public: - explicit ResourceLocalDirConfigWidget(QWidget* parent =3D 0); - - public slots: - virtual void loadSettings(KRES::Resource*); - virtual void saveSettings(KRES::Resource*); - - private: - KUrlRequester* mURL; -}; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcelocalwidget.cpp b/kalarm/resources/re= sourcelocalwidget.cpp deleted file mode 100644 index 4b10017..0000000 --- a/kalarm/resources/resourcelocalwidget.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * resourcelocalwidget.cpp - configuration widget for a local file cale= ndar resource - * Program: kalarm - * Copyright =C2=A9 2006,2008,2010 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resourcelocal.h" -#include "resourcelocalwidget.moc" - -#include -#include -#include -#include - -#include -#include - -#include - - -ResourceLocalConfigWidget::ResourceLocalConfigWidget(QWidget* parent) - : ResourceConfigWidget(parent) -{ - QGridLayout* layout =3D new QGridLayout(this); - - QLabel* label =3D new QLabel(i18nc("@label:textbox", "Location:"), thi= s); - layout->addWidget(label, 1, 0); - mURL =3D new KUrlRequester(this); - mURL->setFilter(QString::fromLatin1("*.vcs *.ics|%1").arg(i18nc("@info= /plain", "Calendar Files"))); - layout->addWidget(mURL, 1, 1); -} - -void ResourceLocalConfigWidget::loadSettings(KRES::Resource* resource) -{ -kDebug(KARES_DEBUG)<(resource); - KAResourceLocal* res =3D static_cast(resource); - if (!res) - kError(KARES_DEBUG) << "KAResourceLocal: cast failed"; - else - { - ResourceConfigWidget::loadSettings(resource); - mURL->setUrl(res->fileName()); -#ifndef NDEBUG - kDebug(KARES_DEBUG) << "File" << mURL->url() << " type" << res->ty= peName(); -#endif - } -} - -void ResourceLocalConfigWidget::saveSettings(KRES::Resource* resource) -{ -// KAResourceLocal* res =3D dynamic_cast(resource); - KAResourceLocal* res =3D static_cast(resource); - if (!res) - kDebug(KARES_DEBUG) << "KAResourceLocal: cast failed"; - else - { - res->setFileName(mURL->url()); - if (mURL->url().isEmpty()) - { - KMessageBox::information(this, i18nc("@info", "No location spe= cified. The calendar will be invalid.")); - resource->setReadOnly(true); - } - } -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcelocalwidget.h b/kalarm/resources/reso= urcelocalwidget.h deleted file mode 100644 index c07b1dc..0000000 --- a/kalarm/resources/resourcelocalwidget.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * resourcelocalwidget.h - configuration widget for local file calendar= resource - * Program: kalarm - * Copyright =C2=A9 2006 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef RESOURCELOCALWIDGET_H -#define RESOURCELOCALWIDGET_H - -/* @file resourcelocalwidget.h - configuration widget for local file calen= dar resource */ - -#include "resourcewidget.h" -#include "kalarm_resources_export.h" - -class KUrlRequester; - -/** - Configuration widget for local file alarm calendar resource. - @see KAResourceLocal -*/ -class KALARM_RESOURCES_EXPORT ResourceLocalConfigWidget : public ResourceC= onfigWidget -{ - Q_OBJECT - public: - explicit ResourceLocalConfigWidget(QWidget* parent =3D 0); - - public slots: - virtual void loadSettings(KRES::Resource*); - virtual void saveSettings(KRES::Resource*); - - private: - KUrlRequester* mURL; -}; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourceremote.cpp b/kalarm/resources/resourc= eremote.cpp deleted file mode 100644 index 684d2b6..0000000 --- a/kalarm/resources/resourceremote.cpp +++ /dev/null @@ -1,368 +0,0 @@ -/* - * resourceremote.cpp - KAlarm remote alarm calendar resource - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * Based on resourceremote.cpp in kresources (updated to rev 721447), - * Copyright (c) 2003,2004 Cornelius Schumacher - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resourceremote.moc" - -//#include -#include - -#include -#include -#include -#include -#include - -using namespace KCal; - - -KAResourceRemote::KAResourceRemote() - : AlarmResource(), - mDownloadJob(0), - mUploadJob(0), - mShowProgress(true), - mUseCacheFile(true), - mRemoteReadOnly(false) -{ - init(); -} - -KAResourceRemote::KAResourceRemote(const KConfigGroup& group) - : AlarmResource(group), - mDownloadJob(0), - mUploadJob(0), - mShowProgress(true), - mUseCacheFile(true), - mRemoteReadOnly(false) -{ - mDownloadUrl =3D KUrl(group.readEntry("DownloadUrl")); - mUploadUrl =3D KUrl(group.readEntry("UploadUrl")); - ResourceCached::readConfig(group ); - init(); -} - -KAResourceRemote::KAResourceRemote(CalEvent::Type type, const KUrl& downlo= adUrl, const KUrl& uploadUrl) - : AlarmResource(type), - mDownloadUrl(downloadUrl), - mUploadUrl(uploadUrl.isEmpty() ? mDownloadUrl : uploadUrl), - mDownloadJob(0), - mUploadJob(0), - mShowProgress(false), - mUseCacheFile(false), - mRemoteReadOnly(false) -{ - init(); -} - -void KAResourceRemote::init() -{ - setType("remote"); // set resource type - lock(cacheFile()); -} - -KAResourceRemote::~KAResourceRemote() -{ - if (isOpen()) - close(); -} - -void KAResourceRemote::doClose() -{ - cancelDownload(); - if (mUploadJob) - { - mUploadJob->kill(); - mUploadJob =3D 0; - } - AlarmResource::doClose(); -} - -void KAResourceRemote::writeConfig(KConfigGroup& group) -{ - group.writeEntry("DownloadUrl", mDownloadUrl.url()); - group.writeEntry("UploadUrl", mUploadUrl.url()); - AlarmResource::writeConfig(group); -} - -void KAResourceRemote::startReconfig() -{ - mNewDownloadUrl =3D mDownloadUrl; - mNewUploadUrl =3D mUploadUrl; - AlarmResource::startReconfig(); -} - -void KAResourceRemote::applyReconfig() -{ - if (mReconfiguring) - { - AlarmResource::applyReconfig(); - if (setUrls(mNewDownloadUrl, mNewUploadUrl)) - mReconfiguring =3D 3; // indicate that location has changed - AlarmResource::applyReconfig(); - } -} - -bool KAResourceRemote::readOnly() const -{ - return mRemoteReadOnly || AlarmResource::readOnly(); -} - -void KAResourceRemote::enableResource(bool enable) -{ - if (!enable) - cancelDownload(false); -} - -bool KAResourceRemote::doLoad(bool syncCache) -{ - if (mUploadJob) - syncCache =3D false; // still uploading, so the cache is up-to-d= ate - if (mDownloadJob) - { - kWarning(KARES_DEBUG) << "Download still in progress"; - return true; - } - mLoaded =3D false; - emit invalidate(this); - calendar()->close(); - setWrongAlarmType(false, false); - clearChanges(); - if (!isActive()) - { - updateCustomEvents(false); // calendar is now empty - return false; - } - mLoading =3D true; - - if (mUseCacheFile || !syncCache) - { - disableChangeNotification(); - syncCache =3D !loadFromCache(); // if cache file doesn't exist = yet, we need to download - mUseCacheFile =3D false; - enableChangeNotification(); - } - emit resourceChanged(this); - - if (!syncCache) - { - kDebug(KARES_DEBUG) << mDownloadUrl.prettyUrl() << ": from cache"; - slotLoadJobResult(0); - } - else if (!lock()->lock()) - { - kDebug(KARES_DEBUG) << mDownloadUrl.prettyUrl() << ": cache file i= s locked - something else must be loading the file"; - updateCustomEvents(); - } - else - { - kDebug(KARES_DEBUG) << mDownloadUrl.prettyUrl() << ": downloading.= .."; - mDownloadJob =3D KIO::file_copy(mDownloadUrl, KUrl(cacheFile()), -= 1, KIO::Overwrite | - ((mShowProgress && hasGui()) ? KIO::DefaultFlags : KIO::HidePr= ogressInfo)); - connect(mDownloadJob, SIGNAL(result(KJob*)), SLOT(slotLoadJobResul= t(KJob*))); -#if 0 - if (mShowProgress && hasGui()) - { - connect(mDownloadJob, SIGNAL(percent(KJob*,ulong)), - SLOT(slotPercent(KJob*,ulong))); - emit downloading(this, 0); - } -#endif - } - return true; -} - -void KAResourceRemote::slotPercent(KJob*, unsigned long percent) -{ - Q_UNUSED(percent); -#if 0 - emit downloading(this, percent); -#endif -} - -void KAResourceRemote::slotLoadJobResult(KJob* job) -{ - bool err =3D false; - if (job) - { - emit invalidate(this); - calendar()->close(); - setWrongAlarmType(false, false); - clearChanges(); - if (job->error()) - { - if (hasGui()) - { - KIO::FileCopyJob* j =3D qobject_cast(jo= b); - if (j) - j->ui()->showErrorMessage(); - } - kError(KARES_DEBUG) << "Resource" << identifier() << " downloa= d error:" << job->errorString(); - setEnabled(false); - err =3D true; - } - else - { - kDebug(KARES_DEBUG) << mDownloadUrl.prettyUrl() << ": success"; - setReloaded(true); // the resource has now been downloaded = at least once - emit cacheDownloaded(this); - disableChangeNotification(); - loadFromCache(); - enableChangeNotification(); - } - -#if 0 - emit downloading(this, (unsigned long)-1); -#endif - } - mDownloadJob =3D 0; - - if (!err) - { - checkCompatibility(cacheFile()); - mLoaded =3D true; - } - mLoading =3D false; - lock()->unlock(); - updateCustomEvents(); - emit loaded(this); - if (job && !err) - emit resourceChanged(this); -} - -void KAResourceRemote::cancelDownload(bool disable) -{ - if (mDownloadJob) - { - mDownloadJob->kill(); - mDownloadJob =3D 0; - if (disable) - setEnabled(false); -#if 0 - emit downloading(this, (unsigned long)-1); -#endif - mLoading =3D false; - lock()->unlock(); - updateCustomEvents(); - emit loaded(this); - } -} - -bool KAResourceRemote::doSave(bool syncCache) -{ - kDebug(KARES_DEBUG) << mUploadUrl.prettyUrl(); - if (readOnly() || !hasChanges()) - return true; - if (mDownloadJob) - { - kWarning(KARES_DEBUG) << "Download still in progress"; - return false; - } - if (mUploadJob) - { - kWarning(KARES_DEBUG) << "Upload still in progress"; - return false; - } - - mChangedIncidences =3D allChanges(); - if (mCalIDFunction) - (*mCalIDFunction)(*calendar()); // write the application ID int= o the calendar - saveToCache(); - if (syncCache) - { - mUploadJob =3D KIO::file_copy(KUrl(cacheFile()), mUploadUrl, -1, K= IO::Overwrite | (hasGui()?KIO::DefaultFlags:KIO::HideProgressInfo)); - connect(mUploadJob, SIGNAL(result(KJob*)), SLOT(slotSaveJobResult(= KJob*))); - } - return true; -} - -void KAResourceRemote::slotSaveJobResult(KJob* job) -{ - if (job->error()) - { - if (hasGui()) - { - KIO::FileCopyJob* j =3D qobject_cast(job); - if (j) - j->ui()->showErrorMessage(); - } - kError(KARES_DEBUG) << "Resource" << identifier() << " upload erro= r:" << job->errorString(); - } - else - { - kDebug(KARES_DEBUG) << mUploadUrl.prettyUrl() << ": success"; - clearChanges(); - } - - mUploadJob =3D 0; - emit resourceSaved(this); - if (closeAfterSave()) - close(); -} - -bool KAResourceRemote::setUrls(const KUrl& downloadUrl, const KUrl& upload= Url) -{ - if (mReconfiguring =3D=3D 1) - { - mNewDownloadUrl =3D downloadUrl; - mNewUploadUrl =3D uploadUrl; - return true; - } - if (downloadUrl.equals(mDownloadUrl) - && uploadUrl.equals(mUploadUrl)) - return false; - kDebug(KARES_DEBUG) << downloadUrl.prettyUrl() << "," << uploadUrl.pre= ttyUrl(); - if (isOpen()) - close(); - bool active =3D isActive(); - if (active) - enableResource(false); - mDownloadUrl =3D downloadUrl; - mUploadUrl =3D uploadUrl; - if (active) - enableResource(true); - // Trigger loading the new resource, and ensure that the new configura= tion is saved - emit locationChanged(this); - return true; -} - -bool KAResourceRemote::setLocation(const QString& downloadUrl, const QStri= ng& uploadUrl) -{ - return setUrls(KUrl(downloadUrl), KUrl(uploadUrl)); -} - -QStringList KAResourceRemote::location() const -{ - return QStringList(downloadUrl().url()) << uploadUrl().url(); -} - -QString KAResourceRemote::displayLocation() const -{ - return mDownloadUrl.prettyUrl(); -} - -QString KAResourceRemote::displayType() const -{ - return i18nc("@info/plain", "URL"); -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourceremote.h b/kalarm/resources/resourcer= emote.h deleted file mode 100644 index 8fb89c2..0000000 --- a/kalarm/resources/resourceremote.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * resourceremote.h - KAlarm remote alarm calendar resource - * Program: kalarm - * Copyright =C2=A9 2006-2011 by David Jarvie - * Based on resourceremote.h in kresources, - * Copyright (c) 2003 Cornelius Schumacher - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef RESOURCEREMOTE_H -#define RESOURCEREMOTE_H - -/* @file resourceremote.h - KAlarm remote alarm calendar resource */ - -#include "alarmresource.h" - -#include -#include - -class KJob; - -namespace KIO { - class FileCopyJob; - class Job; -} -namespace KPIM { class ProgressItem; } -namespace KCal { class CalendarLocal; } - - -/** A KAlarm calendar resource stored as a remote file. */ -class KALARM_RESOURCES_EXPORT KAResourceRemote : public AlarmResource -{ - Q_OBJECT - public: - KAResourceRemote(); - /** Create resource from configuration information stored in a KCo= nfig object. */ - explicit KAResourceRemote(const KConfigGroup&); - /** Create remote resource. - * @param downloadUrl URL used to download iCalendar file - * @param uploadUrl URL used to upload iCalendar file. */ - KAResourceRemote(CalEvent::Type, const KUrl& downloadUrl, const KU= rl& uploadUrl =3D KUrl()); - virtual ~KAResourceRemote(); - bool setUrls(const KUrl& downloadUrl, const KUrl& uploadUr= l); - KUrl downloadUrl() const { return mDownload= Url; } - KUrl uploadUrl() const { return mUploadUr= l; } - virtual QString displayType() const; - virtual QString displayLocation() const; - virtual QStringList location() const; - virtual bool setLocation(const QString& downloadUrl, const = QString& uploadUrl); - virtual bool readOnly() const; - virtual void showProgress(bool show) { mShowProgress = =3D show; } - virtual void writeConfig(KConfigGroup&); - virtual void startReconfig(); - virtual void applyReconfig(); - virtual bool isSaving() { return mUploadJo= b; } - virtual bool cached() const { return true; } - - // Override abstract virtual functions - virtual KCal::Todo::List rawTodos(KCal::TodoSortField =3D KCal::To= doSortUnsorted, KCal::SortDirection =3D KCal::SortDirectionAscending) { re= turn KCal::Todo::List(); } - virtual KCal::Journal::List rawJournals(KCal::JournalSortField =3D= KCal::JournalSortUnsorted, KCal::SortDirection =3D KCal::SortDirectionAsce= nding) { return KCal::Journal::List(); } - - public slots: - virtual void cancelDownload(bool disable =3D true); - - protected: - virtual bool doLoad(bool syncCache); - virtual bool doSave(bool syncCache); - virtual bool doSave(bool syncCache, KCal::Incidence* i) { return = AlarmResource::doSave(syncCache, i); } - virtual void doClose(); - virtual void enableResource(bool enable); - - private slots: - void slotLoadJobResult(KJob*); - void slotSaveJobResult(KJob*); - void slotPercent(KJob*, unsigned long percent); - - private: - void init(); - // Inherited virtual methods which are not used by derived classes - using ResourceCalendar::doLoad; - virtual bool doSave() { return false; } - virtual bool doSave(KCal::Incidence*) { return false; } - - KUrl mDownloadUrl; - KUrl mUploadUrl; - KIO::FileCopyJob* mDownloadJob; - KIO::FileCopyJob* mUploadJob; - KCal::Incidence::List mChangedIncidences; - KUrl mNewDownloadUrl; // new download URL to= be applied by applyReconfig() - KUrl mNewUploadUrl; // new upload URL to b= e applied by applyReconfig() - bool mShowProgress; // emit download progr= ess signals - bool mUseCacheFile; // true to initially u= se cache until file can be downloaded - bool mRemoteReadOnly; // the remote file is = read-only -}; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourceremote_plugin.cpp b/kalarm/resources/= resourceremote_plugin.cpp deleted file mode 100644 index de3bff6..0000000 --- a/kalarm/resources/resourceremote_plugin.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * resourceremote_plugin.cpp - KAlarm remote alarm calendar file resour= ce plugin - * Program: kalarm - * Copyright =C2=A9 2006 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resourceremote.h" -#include "resourceremotewidget.h" - -#include -#include - -extern "C" -{ - KDE_EXPORT void* init_kalarm_remote() - { -#ifndef KALARM_STANDALONE - KGlobal::locale()->insertCatalog("libkcal"); - KGlobal::locale()->insertCatalog("kres_remote"); -#endif - return new KRES::PluginFactory(); - } -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourceremotewidget.cpp b/kalarm/resources/r= esourceremotewidget.cpp deleted file mode 100644 index 72b42ab..0000000 --- a/kalarm/resources/resourceremotewidget.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * resourceremotewidget.cpp - configuration widget for a remote file ca= lendar resource - * Program: kalarm - * Copyright =C2=A9 2006,2008 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "resourceremote.h" -#include "resourceremotewidget.moc" - -#include - -#include -#include -#include -#include - -#include -#include - - -ResourceRemoteConfigWidget::ResourceRemoteConfigWidget(QWidget* parent) - : ResourceConfigWidget(parent) -{ - QGridLayout* layout =3D new QGridLayout(this); - - QLabel* label =3D new QLabel(i18nc("@label:textbox", "Download from:")= , this); - layout->addWidget(label, 1, 0); - mDownloadUrl =3D new KUrlRequester(this); - mDownloadUrl->setMode(KFile::File); - layout->addWidget(mDownloadUrl, 1, 1); - - label =3D new QLabel(i18nc("@label:textbox", "Upload to:"), this); - layout->addWidget(label, 2, 0); - mUploadUrl =3D new KUrlRequester(this); - mUploadUrl->setMode(KFile::File); - layout->addWidget(mUploadUrl, 2, 1); - - mReloadConfig =3D new KCal::ResourceCachedReloadConfig(this); - layout->addWidget(mReloadConfig, 3, 0, 1, 2); - - mSaveConfig =3D new KCal::ResourceCachedSaveConfig(this); - layout->addWidget(mSaveConfig, 4, 0, 1, 2); -} - -void ResourceRemoteConfigWidget::loadSettings(KRES::Resource* resource) -{ -// KAResourceRemote* res =3D dynamic_cast(resource); - KAResourceRemote* res =3D static_cast(resource); - if (!res) - kError(KARES_DEBUG) << "KAResourceRemote: cast failed"; - else - { - ResourceConfigWidget::loadSettings(resource); - mDownloadUrl->setUrl(res->downloadUrl().url()); - mUploadUrl->setUrl(res->uploadUrl().url()); - mReloadConfig->loadSettings(res); - mSaveConfig->loadSettings(res); -#ifndef NDEBUG - kDebug(KARES_DEBUG) << "File" << mDownloadUrl->url() << " type" <<= res->typeName(); -#endif - } -} - -void ResourceRemoteConfigWidget::saveSettings(KRES::Resource* resource) -{ -// KAResourceRemote* res =3D dynamic_cast(resource); - KAResourceRemote* res =3D static_cast(resource); - if (!res) - kDebug(KARES_DEBUG) << "KAResourceRemote: cast failed"; - else - { - res->setUrls(mDownloadUrl->url(), mUploadUrl->url()); - mReloadConfig->saveSettings(res); - mSaveConfig->saveSettings(res); - - if (mUploadUrl->url().isEmpty() && !resource->readOnly()) - { - KMessageBox::information(this, i18nc("@info", "You have specif= ied no upload URL: the alarm calendar will be read-only."), - "RemoteResourseNoUploadURL"); - resource->setReadOnly(true); - } - } -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourceremotewidget.h b/kalarm/resources/res= ourceremotewidget.h deleted file mode 100644 index d32e607..0000000 --- a/kalarm/resources/resourceremotewidget.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * resourceremotewidget.h - configuration widget for remote file calend= ar resource - * Program: kalarm - * Copyright =C2=A9 2006 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef RESOURCEREMOTEWIDGET_H -#define RESOURCEREMOTEWIDGET_H - -/* @file resourceremotewidget.h - configuration widget for remote file cal= endar resource */ - -#include "resourcewidget.h" -#include "kalarm_resources_export.h" - -class KUrlRequester; -namespace KRES { class Resource; } -namespace KCal { - class ResourceCachedReloadConfig; - class ResourceCachedSaveConfig; -} - -/** - Configuration widget for remote file alarm calendar resource. - @see KAResourceRemote -*/ -class KALARM_RESOURCES_EXPORT ResourceRemoteConfigWidget : public Resource= ConfigWidget -{ - Q_OBJECT - public: - explicit ResourceRemoteConfigWidget(QWidget* parent =3D 0); - - public slots: - virtual void loadSettings(KRES::Resource*); - virtual void saveSettings(KRES::Resource*); - - private: - KUrlRequester* mDownloadUrl; - KUrlRequester* mUploadUrl; - KCal::ResourceCachedReloadConfig* mReloadConfig; - KCal::ResourceCachedSaveConfig* mSaveConfig; -}; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcewidget.cpp b/kalarm/resources/resourc= ewidget.cpp deleted file mode 100644 index 57fa318..0000000 --- a/kalarm/resources/resourcewidget.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * resourcewidget.cpp - base class for resource configuration widgets - * Program: kalarm - * Copyright =C2=A9 2006,2009 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" - -#include "alarmresource.h" -#include "resourcewidget.moc" - -#include -#include - -//#include - - -ResourceConfigWidget::ResourceConfigWidget(QWidget* parent) - : KRES::ConfigWidget(parent) -{ - resize(245, 115); = -} - -void ResourceConfigWidget::loadSettings(KRES::Resource* resource) -{ -// AlarmResource* res =3D dynamic_cast(resource); - AlarmResource* res =3D static_cast(resource); - if (res) - connect(res, SIGNAL(notWritable(AlarmResource*)), SLOT(slotNotWrit= able(AlarmResource*))); -} - -/*************************************************************************= ***** -* Called when the user tries to change the resource to read-write, but thi= s is -* not allowed because the resource was not written by KAlarm (or was writt= en by -* a later version of KAlarm). -* Display an error message. -*/ -void ResourceConfigWidget::slotNotWritable(AlarmResource* resource) -{ - QString text =3D i18nc("@info", "Calendar %1 cann= ot be made writable since it either was not created by KAlarm<= /application>, or was created by a newer version of KAlarm", resource->resourceName()); - KMessageBox::sorry(this, text); -} - -// vim: et sw=3D4: diff --git a/kalarm/resources/resourcewidget.h b/kalarm/resources/resourcew= idget.h deleted file mode 100644 index 8ecd624..0000000 --- a/kalarm/resources/resourcewidget.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * resourcewidget.h - base class for resource configuration widgets - * Program: kalarm - * Copyright =C2=A9 2006 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef RESOURCEWIDGET_H -#define RESOURCEWIDGET_H - -/* @file resourcewidget.h - base class for resource configuration widgets = */ - -#include - -class AlarmResource; - -/** - Configuration widget for alarm calendar resource. - @see AlarmResource -*/ -class ResourceConfigWidget : public KRES::ConfigWidget -{ = - Q_OBJECT - public: - explicit ResourceConfigWidget(QWidget* parent =3D 0); - - public slots: - virtual void loadSettings(KRES::Resource*); - - private slots: - void slotNotWritable(AlarmResource*); -}; - -#endif - -// vim: et sw=3D4: diff --git a/kalarm/templatelistfiltermodel.cpp b/kalarm/templatelistfilter= model.cpp deleted file mode 100644 index 56f18db..0000000 --- a/kalarm/templatelistfiltermodel.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - * templatelistfiltermodel.cpp - proxy model class for lists of alarm t= emplates - * Program: kalarm - * Copyright =C2=A9 2007,2009-2011 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kalarm.h" //krazy:exclude=3Dincludes (kalarm.h must be first) -#include "templatelistfiltermodel.h" - -#include -#include - -#include - -using namespace KAlarmCal; - -// TemplateListFilterModel provides sorting and filtering for the alarm li= st model. - - -void TemplateListFilterModel::setTypeFilter(KAEvent::Actions type) -{ - if (type !=3D mTypeFilter) - { - mTypeFilter =3D type; - invalidateFilter(); - } -} - -void TemplateListFilterModel::setTypesEnabled(KAEvent::Actions type) -{ - if (type !=3D mTypesEnabled) - { - mTypesEnabled =3D type; - invalidateFilter(); - } -} - -bool TemplateListFilterModel::filterAcceptsRow(int sourceRow, const QModel= Index&) const -{ - QModelIndex sourceIndex =3D sourceModel()->index(sourceRow, 0); - if (sourceModel()->data(sourceIndex, EventListModel::StatusRole).toInt= () !=3D CalEvent::TEMPLATE) - return false; - if (mTypeFilter =3D=3D KAEvent::ACT_ALL) - return true; - KAEvent::Actions type =3D static_cast(sourceModel())-= >event(sourceIndex)->actionTypes(); - if (type =3D=3D KAEvent::ACT_DISPLAY_COMMAND) - type =3D KAEvent::ACT_DISPLAY; - return type & mTypeFilter; -} - -bool TemplateListFilterModel::filterAcceptsColumn(int sourceCol, const QMo= delIndex&) const -{ - return sourceCol =3D=3D EventListModel::TemplateNameColumn - || sourceCol =3D=3D EventListModel::TypeColumn; -} - -QModelIndex TemplateListFilterModel::mapFromSource(const QModelIndex& sour= ceIndex) const -{ - int proxyColumn; - switch (sourceIndex.column()) - { - case EventListModel::TypeColumn: - proxyColumn =3D TypeColumn; - break; - case EventListModel::TemplateNameColumn: - proxyColumn =3D TemplateNameColumn; - break; - default: - return QModelIndex(); - } - QModelIndex ix =3D EventListFilterModel::mapFromSource(sourceIndex); - return index(ix.row(), proxyColumn, ix.parent()); -} - -QModelIndex TemplateListFilterModel::mapToSource(const QModelIndex& proxyI= ndex) const -{ - int sourceColumn; - switch (proxyIndex.column()) - { - case TypeColumn: - sourceColumn =3D EventListModel::TypeColumn; - break; - case TemplateNameColumn: - sourceColumn =3D EventListModel::TemplateNameColumn; - break; - default: - return QModelIndex(); - } - return EventListFilterModel::mapToSource(proxyIndex); -} - -Qt::ItemFlags TemplateListFilterModel::flags(const QModelIndex& index) con= st -{ - QModelIndex sourceIndex =3D mapToSource(index); - Qt::ItemFlags f =3D sourceModel()->flags(sourceIndex); - if (mTypesEnabled =3D=3D KAEvent::ACT_ALL) - return f; - KAEvent::Actions type =3D static_cast(sourceModel())-= >event(sourceIndex)->actionTypes(); - if (type =3D=3D KAEvent::ACT_DISPLAY_COMMAND) - type =3D KAEvent::ACT_DISPLAY; - if (!(type & mTypesEnabled)) - f =3D static_cast(f & ~(Qt::ItemIsEnabled | Qt::Ite= mIsSelectable)); - return f; -} - -// vim: et sw=3D4: diff --git a/kalarm/templatelistfiltermodel.h b/kalarm/templatelistfiltermo= del.h deleted file mode 100644 index 46c3354..0000000 --- a/kalarm/templatelistfiltermodel.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * templatelistfiltermodel.h - proxy model class for lists of alarm tem= plates - * Program: kalarm - * Copyright =C2=A9 2007,2009,2010 by David Jarvie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef TEMPLATELISTFILTERMODEL_H -#define TEMPLATELISTFILTERMODEL_H - -#include "kalarm.h" - -#include "eventlistmodel.h" - - -class TemplateListFilterModel : public EventListFilterModel -{ - Q_OBJECT - public: - enum { // data columns - TypeColumn, TemplateNameColumn, - ColumnCount - }; - - explicit TemplateListFilterModel(EventListModel* baseModel, QObjec= t* parent =3D 0) - : EventListFilterModel(baseModel, parent), - mTypesEnabled(KAEvent::ACT_ALL), - mTypeFilter(KAEvent::ACT_ALL) {} - void setTypeFilter(KAEvent::Actions); - void setTypesEnabled(KAEvent::Actions); - virtual QModelIndex mapFromSource(const QModelIndex& sourceIndex) = const; - virtual QModelIndex mapToSource(const QModelIndex& proxyIndex) con= st; - virtual Qt::ItemFlags flags(const QModelIndex&) const; - - protected: - virtual bool filterAcceptsRow(int sourceRow, const QModelIndex& so= urceParent) const; - virtual bool filterAcceptsColumn(int sourceCol, const QModelIndex&= sourceParent) const; - - private: - KAEvent::Actions mTypesEnabled; // disable types not in this mask - KAEvent::Actions mTypeFilter; // hide types not in this mask -}; - -#endif // TEMPLATELISTFILTERMODEL_H - -// vim: et sw=3D4: