Commit 57c406b3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

add missing Q_REQUIRED_RESULT

parent 43ce9bac
......@@ -120,17 +120,17 @@ private:
void removeFromConfig(const QList<Akonadi::Item::Id> &);
// Opens through dbus, @deprecated
bool openIncidenceEditorThroughKOrganizer(const KCalendarCore::Incidence::Ptr &incidence);
Q_REQUIRED_RESULT bool openIncidenceEditorThroughKOrganizer(const KCalendarCore::Incidence::Ptr &incidence);
// opens directly
bool openIncidenceEditorNG(const Akonadi::Item &incidence);
Q_REQUIRED_RESULT bool openIncidenceEditorNG(const Akonadi::Item &incidence);
bool startKOrganizer();
Q_REQUIRED_RESULT bool startKOrganizer();
ReminderTreeItem *searchByItem(const Akonadi::Item &incidence);
void setTimer();
void dismiss(const ReminderList &selections);
int activeCount();
ReminderList selectedItems() const;
Q_REQUIRED_RESULT int activeCount();
Q_REQUIRED_RESULT ReminderList selectedItems() const;
void toggleDetails(QTreeWidgetItem *item);
void showDetails(QTreeWidgetItem *item);
static bool grabFocus();
......
......@@ -49,8 +49,8 @@ public:
void hide();
void show();
void forceAlarmCheck();
QString dumpDebug() const;
QStringList dumpAlarms() const;
Q_REQUIRED_RESULT QString dumpDebug() const;
Q_REQUIRED_RESULT QStringList dumpAlarms() const;
public Q_SLOTS:
void slotQuit();
......
......@@ -47,11 +47,11 @@ public:
MailClient();
~MailClient();
bool mailAttendees(const KCalendarCore::IncidenceBase::Ptr &, const KIdentityManagement::Identity &identity, bool bccMe, const QString &attachment = QString(), const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool mailAttendees(const KCalendarCore::IncidenceBase::Ptr &, const KIdentityManagement::Identity &identity, bool bccMe, const QString &attachment = QString(), const QString &mailTransport = QString());
bool mailOrganizer(const KCalendarCore::IncidenceBase::Ptr &, const KIdentityManagement::Identity &identity, const QString &from, bool bccMe, const QString &attachment = QString(), const QString &sub = QString(), const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool mailOrganizer(const KCalendarCore::IncidenceBase::Ptr &, const KIdentityManagement::Identity &identity, const QString &from, bool bccMe, const QString &attachment = QString(), const QString &sub = QString(), const QString &mailTransport = QString());
bool mailTo(const KCalendarCore::IncidenceBase::Ptr &, const KIdentityManagement::Identity &identity, const QString &from, bool bccMe, const QString &recipients, const QString &attachment = QString(), const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool mailTo(const KCalendarCore::IncidenceBase::Ptr &, const KIdentityManagement::Identity &identity, const QString &from, bool bccMe, const QString &recipients, const QString &attachment = QString(), const QString &mailTransport = QString());
/**
Sends mail with specified from, to and subject field and body as text.
......@@ -70,7 +70,7 @@ public:
@param mailTransport defines the mail transport method. See here the
kdepimlibs/mailtransport library.
*/
bool send(const KIdentityManagement::Identity &identity, const QString &from, const QString &to, const QString &cc, const QString &subject, const QString &body, bool hidden = false, bool bccMe = false, const QString &attachment = QString(), const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool send(const KIdentityManagement::Identity &identity, const QString &from, const QString &to, const QString &cc, const QString &subject, const QString &body, bool hidden = false, bool bccMe = false, const QString &attachment = QString(), const QString &mailTransport = QString());
};
}
......
......@@ -84,16 +84,16 @@ public Q_SLOTS:
bool importURL(const QUrl &url, bool merge);
/** Save calendar file to URL of current calendar */
bool saveURL();
Q_REQUIRED_RESULT bool saveURL();
/** Save calendar file to URL */
bool saveAsURL(const QUrl &QUrl);
Q_REQUIRED_RESULT bool saveAsURL(const QUrl &QUrl);
void toggleMenubar(bool dontShowWarning = false);
public:
/** Get current URL */
QUrl url() const
Q_REQUIRED_RESULT QUrl url() const
{
return mURL;
}
......@@ -102,16 +102,16 @@ public:
static KOrg::MainWindow *findInstance(const QUrl &url);
/** Open calendar file from URL */
bool openURL(const QString &url);
Q_REQUIRED_RESULT bool openURL(const QString &url);
/** Open calendar file from URL */
bool mergeURL(const QString &url);
Q_REQUIRED_RESULT bool mergeURL(const QString &url);
/** Save calendar file to URL */
bool saveAsURL(const QString &url);
Q_REQUIRED_RESULT bool saveAsURL(const QString &url);
/** Get current URL as QString */
QString getCurrentURLasString() const;
Q_REQUIRED_RESULT QString getCurrentURLasString() const;
/**
Delete the incidence with the given unique id from current calendar.
......
......@@ -80,10 +80,10 @@ public:
KCheckableProxyModel *collectionSelectionProxyModel() const;
void setCollectionSelectionProxyModel(KCheckableProxyModel *);
Akonadi::Collection selectedCollection() const;
Akonadi::Collection::List checkedCollections() const;
bool isChecked(const Akonadi::Collection &) const;
Akonadi::Collection currentCalendar() const;
Q_REQUIRED_RESULT Akonadi::Collection selectedCollection() const;
Q_REQUIRED_RESULT Akonadi::Collection::List checkedCollections() const;
Q_REQUIRED_RESULT bool isChecked(const Akonadi::Collection &) const;
Q_REQUIRED_RESULT Akonadi::Collection currentCalendar() const;
Q_SIGNALS:
void resourcesChanged(bool enabled);
......
......@@ -179,8 +179,8 @@ public:
*/
void updateHighlightModes();
QDate startDate() override;
QDate endDate() override;
Q_REQUIRED_RESULT QDate startDate() override;
Q_REQUIRED_RESULT QDate endDate() override;
KOrg::BaseView *currentView() const;
void addView(KOrg::BaseView *) override;
......@@ -196,23 +196,23 @@ public:
* Returns the item selected in the current view (or an invalid one if none selected)
* @reimp
*/
Akonadi::Item currentSelection() override;
Q_REQUIRED_RESULT Akonadi::Item currentSelection() override;
/**
* Returns a pointer to the incidence selected in the current view. If there
* is no selection, return the selected todo from the todo list on the left.
*/
Akonadi::Item selectedIncidence();
Q_REQUIRED_RESULT Akonadi::Item selectedIncidence();
/**
* Returns true if there's a filter applied.
*/
bool isFiltered() const;
Q_REQUIRED_RESULT bool isFiltered() const;
/**
* Returns the name of the current filter.
*/
QString currentFilterName() const;
Q_REQUIRED_RESULT QString currentFilterName() const;
Q_SIGNALS:
/** when change is made to options dialog, the topwidget will catch this
......
......@@ -45,9 +45,9 @@ public:
explicit DateNavigator(QObject *parent = nullptr);
~DateNavigator();
KCalendarCore::DateList selectedDates();
Q_REQUIRED_RESULT KCalendarCore::DateList selectedDates();
int datesCount() const;
Q_REQUIRED_RESULT int datesCount() const;
public Q_SLOTS:
void selectDates(const KCalendarCore::DateList &, const QDate &preferredMonth = QDate());
......
......@@ -59,7 +59,7 @@ public:
functions.
An invalid QDate() is returned if the index is too big or too small.
*/
QDate monthOfNavigator(int navigatorIndex = 0) const;
Q_REQUIRED_RESULT QDate monthOfNavigator(int navigatorIndex = 0) const;
public Q_SLOTS:
/**
......
......@@ -48,11 +48,11 @@ public:
explicit NoteEditDialog(QWidget *parent = nullptr);
~NoteEditDialog() override;
Akonadi::Collection collection() const;
Q_REQUIRED_RESULT Akonadi::Collection collection() const;
void setCollection(const Akonadi::Collection &value);
void load(const Akonadi::Item &item);
KMime::Message::Ptr note() const;
Q_REQUIRED_RESULT KMime::Message::Ptr note() const;
//Used for tests
static QAbstractItemModel *_k_noteEditStubModel;
......
......@@ -47,19 +47,19 @@ public:
~KOrganizerIfaceImpl();
public Q_SLOTS:
bool openURL(const QString &url);
bool mergeURL(const QString &url);
bool saveURL();
bool saveAsURL(const QString &url);
QString getCurrentURLasString() const;
Q_REQUIRED_RESULT bool openURL(const QString &url);
Q_REQUIRED_RESULT bool mergeURL(const QString &url);
Q_REQUIRED_RESULT bool saveURL();
Q_REQUIRED_RESULT bool saveAsURL(const QString &url);
Q_REQUIRED_RESULT QString getCurrentURLasString() const;
bool editIncidence(const QString &akonadiUrl);
Q_REQUIRED_RESULT bool editIncidence(const QString &akonadiUrl);
/** @reimp from KOrganizerIface::deleteIncidence()
@param akonadiUrl the akonadi Item URL of the item to delete. if no such item exists,
nothing happens
@return true if the item could be deleted, false otherwise
*/
bool deleteIncidence(const QString &akonadiUrl)
Q_REQUIRED_RESULT bool deleteIncidence(const QString &akonadiUrl)
{
return deleteIncidence(akonadiUrl, false);
}
......@@ -70,7 +70,7 @@ public Q_SLOTS:
@param force If true, all recurrences and sub-todos (if applicable) will
be deleted without prompting for confirmation.
*/
bool deleteIncidence(const QString &akonadiUrl, bool force);
Q_REQUIRED_RESULT bool deleteIncidence(const QString &akonadiUrl, bool force);
/**
Add an incidence to the active calendar.
......@@ -80,28 +80,28 @@ public Q_SLOTS:
optionally a VTIMEZONE component. If there is more than one
incidence, only the first is added to KOrganizer's calendar.
*/
bool addIncidence(const QString &iCal);
Q_REQUIRED_RESULT bool addIncidence(const QString &iCal);
/**
Show a HTML representation of the incidence (the "View.." dialog).
If no incidence with the given Akonadi Item URL exists, nothing happens.
@param akonadiUrl The Akonadi Item URL of the incidence to be shown.
*/
bool showIncidence(const QString &akonadiUrl);
Q_REQUIRED_RESULT bool showIncidence(const QString &akonadiUrl);
/**
Show an incidence in context. This means showing the todo, agenda or
journal view (as appropriate) and scrolling it to show the incidence.
@param akonadiUrl the Akonadi Item URL of the incidence to show.
*/
bool showIncidenceContext(const QString &akonadiUrl);
Q_REQUIRED_RESULT bool showIncidenceContext(const QString &akonadiUrl);
/**
* Called by KOrganizerUniqueAppHandler in the kontact plugin
* Returns true if the command line was successfully handled
* false otherwise.
*/
bool handleCommandLine(const QStringList &args);
Q_REQUIRED_RESULT bool handleCommandLine(const QStringList &args);
private:
ActionManager *mActionManager = nullptr;
......
......@@ -44,9 +44,9 @@ public:
static KOCore *self();
KService::List availablePlugins();
KService::List availableCalendarDecorations();
KService::List availableParts();
Q_REQUIRED_RESULT KService::List availablePlugins();
Q_REQUIRED_RESULT KService::List availableCalendarDecorations();
Q_REQUIRED_RESULT KService::List availableParts();
CalendarSupport::Plugin *loadPlugin(const KService::Ptr &service);
CalendarSupport::Plugin *loadPlugin(const QString &);
......
......@@ -43,11 +43,11 @@ public:
{
}
QColor categoryColor(const QStringList &cats) override;
Q_REQUIRED_RESULT QColor categoryColor(const QStringList &cats) override;
QString holidayString(const QDate &dt) override;
Q_REQUIRED_RESULT QString holidayString(const QDate &dt) override;
QTime dayStart() override
Q_REQUIRED_RESULT QTime dayStart() override
{
return KOPrefs::instance()->mDayBegins.time();
}
......
......@@ -144,7 +144,7 @@ public:
/** Is today visible in the view? Keep this in sync with
* the values today (below) can take.
*/
bool isTodayVisible() const
Q_REQUIRED_RESULT bool isTodayVisible() const
{
return mToday >= 0;
}
......@@ -156,12 +156,12 @@ public:
* in the array of visible dates and going from
* top left (0) to bottom right (41).
*/
bool isBeginningOfMonth() const
Q_REQUIRED_RESULT bool isBeginningOfMonth() const
{
return mToday <= 8;
}
bool isEndOfMonth() const
Q_REQUIRED_RESULT bool isEndOfMonth() const
{
return mToday >= 27;
}
......
......@@ -46,16 +46,16 @@ public:
~KOGlobals();
QMap<QDate, QStringList> holiday(const QDate &start, const QDate &end) const;
Q_REQUIRED_RESULT QMap<QDate, QStringList> holiday(const QDate &start, const QDate &end) const;
int firstDayOfWeek() const;
Q_REQUIRED_RESULT int firstDayOfWeek() const;
/**
Returns a list containing work days between @p start and @end.
*/
QList<QDate> workDays(const QDate &start, const QDate &end) const;
Q_REQUIRED_RESULT QList<QDate> workDays(const QDate &start, const QDate &end) const;
int getWorkWeekMask();
Q_REQUIRED_RESULT int getWorkWeekMask();
/**
Set which holiday regions the user wants to use.
......
......@@ -53,7 +53,7 @@ public:
return 3;
}
QStringList configModules() const override;
Q_REQUIRED_RESULT QStringList configModules() const override;
void configUpdated();
void updateSummary(bool force = false) override
{
......@@ -62,7 +62,7 @@ public:
}
protected:
bool eventFilter(QObject *obj, QEvent *e) override;
Q_REQUIRED_RESULT bool eventFilter(QObject *obj, QEvent *e) override;
private Q_SLOTS:
void updateView();
......
......@@ -39,13 +39,13 @@ public:
JournalPlugin(KontactInterface::Core *core, const QVariantList &);
~JournalPlugin() override;
bool isRunningStandalone() const override;
Q_REQUIRED_RESULT bool isRunningStandalone() const override;
int weight() const override
{
return 525;
}
QStringList invisibleToolbarActions() const override;
Q_REQUIRED_RESULT QStringList invisibleToolbarActions() const override;
void select() override;
......
......@@ -41,18 +41,18 @@ public:
KOrganizerPlugin(KontactInterface::Core *core, const QVariantList &);
~KOrganizerPlugin() override;
bool isRunningStandalone() const override;
Q_REQUIRED_RESULT bool isRunningStandalone() const override;
int weight() const override
{
return 400;
}
bool canDecodeMimeData(const QMimeData *) const override;
Q_REQUIRED_RESULT bool canDecodeMimeData(const QMimeData *) const override;
void processDropEvent(QDropEvent *) override;
KontactInterface::Summary *createSummaryWidget(QWidget *parent) override;
QStringList invisibleToolbarActions() const override;
Q_REQUIRED_RESULT QStringList invisibleToolbarActions() const override;
void select() override;
......
......@@ -39,16 +39,16 @@ public:
TodoPlugin(KontactInterface::Core *core, const QVariantList &);
~TodoPlugin() override;
bool isRunningStandalone() const override;
Q_REQUIRED_RESULT bool isRunningStandalone() const override;
int weight() const override
{
return 450;
}
bool canDecodeMimeData(const QMimeData *) const override;
Q_REQUIRED_RESULT bool canDecodeMimeData(const QMimeData *) const override;
void processDropEvent(QDropEvent *) override;
QStringList invisibleToolbarActions() const override;
Q_REQUIRED_RESULT QStringList invisibleToolbarActions() const override;
KontactInterface::Summary *createSummaryWidget(QWidget *parent) override;
......
......@@ -55,7 +55,7 @@ public:
return 3;
}
QStringList configModules() const override;
Q_REQUIRED_RESULT QStringList configModules() const override;
public Q_SLOTS:
void updateSummary(bool force = false) override
......
......@@ -53,7 +53,7 @@ public:
SDSummaryWidget(KontactInterface::Plugin *plugin, QWidget *parent);
~SDSummaryWidget() override;
QStringList configModules() const override;
Q_REQUIRED_RESULT QStringList configModules() const override;
void configUpdated();
void updateSummary(bool force = false) override
{
......
......@@ -71,16 +71,16 @@ public:
false if the URL should be added as a new resource.
@return true on success, false if an error occurred
*/
bool openURL(const QUrl &url, bool merge = false) override;
Q_REQUIRED_RESULT bool openURL(const QUrl &url, bool merge = false) override;
/** Save calendar file to URL of current calendar */
bool saveURL() override;
Q_REQUIRED_RESULT bool saveURL() override;
/** Save calendar file to URL */
bool saveAsURL(const QUrl &url) override;
Q_REQUIRED_RESULT bool saveAsURL(const QUrl &url) override;
/** Get current URL */
QUrl getCurrentURL() const override;
Q_REQUIRED_RESULT QUrl getCurrentURL() const override;
KXMLGUIFactory *mainGuiFactory() override;
KXMLGUIClient *mainGuiClient() override;
......
......@@ -58,16 +58,16 @@ public:
@return true on success, false if an error occurred
*/
bool openURL(const QUrl &url, bool merge = false) override;
Q_REQUIRED_RESULT bool openURL(const QUrl &url, bool merge = false) override;
/** Save calendar file to URL of current calendar */
bool saveURL() override;
Q_REQUIRED_RESULT bool saveURL() override;
/** Save calendar file to URL */
bool saveAsURL(const QUrl &url) override;
Q_REQUIRED_RESULT bool saveAsURL(const QUrl &url) override;
/** Get current URL */
QUrl getCurrentURL() const override;
Q_REQUIRED_RESULT QUrl getCurrentURL() const override;
KXMLGUIFactory *mainGuiFactory() override
{
......
......@@ -98,13 +98,13 @@ public:
void connectView(KOrg::BaseView *);
void addView(KOrg::BaseView *, bool isTab = false);
Akonadi::Item currentSelection();
Q_REQUIRED_RESULT Akonadi::Item currentSelection();
/**
* If there's a selected incidence, it's date is returned, otherwise
* an invalid QDate is returned.
*/
QDate currentSelectionDate();
Q_REQUIRED_RESULT QDate currentSelectionDate();
KOAgendaView *agendaView() const
{
......@@ -135,13 +135,13 @@ public:
* to know if agenda is selected, because agenda has other modes
* (tabbed, side by side). Use this function instead.
*/
bool agendaIsSelected() const;
Q_REQUIRED_RESULT bool agendaIsSelected() const;
/**
Return the current range mode:
week, work week, day or nextX days, etc.
*/
RangeMode rangeMode() const
Q_REQUIRED_RESULT RangeMode rangeMode() const
{
return mRangeMode;
}
......
......@@ -55,7 +55,7 @@ public:
/**
Is there only one instance left?
*/
bool lastInstance();
Q_REQUIRED_RESULT bool lastInstance();
/**
Is there a instance with this URL?
......
......@@ -42,34 +42,34 @@ public:
~KOAgendaView() override;
/** Returns maximum number of days supported by the koagendaview */
int maxDatesHint() const override;
Q_REQUIRED_RESULT int maxDatesHint() const override;
/** Returns number of currently shown dates. */
int currentDateCount() const override;
Q_REQUIRED_RESULT int currentDateCount() const override;
/** returns the currently selected events */
Akonadi::Item::List selectedIncidences() override;
Q_REQUIRED_RESULT Akonadi::Item::List selectedIncidences() override;
/** returns the currently selected incidence's dates */
KCalendarCore::DateList selectedIncidenceDates() override;
Q_REQUIRED_RESULT KCalendarCore::DateList selectedIncidenceDates() override;
/** return the default start/end date/time for new events */
bool eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay) override;
Q_REQUIRED_RESULT bool eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay) override;
CalendarSupport::CalPrinter::PrintType printType() const override;
Q_REQUIRED_RESULT CalendarSupport::CalPrinter::PrintType printType() const override;
/** start-datetime of selection */
QDateTime selectionStart() override;
Q_REQUIRED_RESULT QDateTime selectionStart() override;
/** end-datetime of selection */
QDateTime selectionEnd() override;
Q_REQUIRED_RESULT QDateTime selectionEnd() override;
/** returns true if selection is for whole day */
bool selectedIsAllDay();
Q_REQUIRED_RESULT bool selectedIsAllDay();
/** make selected start/end invalid */
void deleteSelectedDateTime();
/** returns if only a single cell is selected, or a range of cells */
bool selectedIsSingleCell();
Q_REQUIRED_RESULT bool selectedIsSingleCell();
/* reimp from BaseView */
void setCalendar(const Akonadi::ETMCalendar::Ptr &cal) override;
......
......@@ -46,10 +46,10 @@ public:
explicit KOJournalView(QWidget *parent = nullptr);
~KOJournalView() override;
int currentDateCount() const override;
Akonadi::Item::List selectedIncidences() override;
Q_REQUIRED_RESULT int currentDateCount() const override;
Q_REQUIRED_RESULT Akonadi::Item::List selectedIncidences() override;
KCalendarCore::DateList selectedIncidenceDates() override
Q_REQUIRED_RESULT KCalendarCore::DateList selectedIncidenceDates() override
{
return KCalendarCore::DateList();
}
......@@ -58,7 +58,7 @@ public:
void getHighlightMode(bool &highlightEvents, bool &highlightTodos, bool &highlightJournals) override;
CalendarSupport::CalPrinterBase::PrintType printType() const override;
Q_REQUIRED_RESULT CalendarSupport::CalPrinterBase::PrintType printType() const override;
public Q_SLOTS:
void updateView() override;
......
......@@ -48,10 +48,10 @@ public:
explicit KOListView(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *parent = nullptr, bool nonInteractive = false);
~KOListView() override;
int maxDatesHint() const override;
int currentDateCount() const override;
Akonadi::Item::List selectedIncidences() override;