mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 04:55:48 +03:00
Merge pull request #4992 from nextcloud/ci/useNoDiscard
Ci/use no discard
This commit is contained in:
commit
311469a0e5
128 changed files with 683 additions and 683 deletions
|
@ -30,25 +30,25 @@ class OWNCLOUDDOLPHINPLUGINHELPER_EXPORT OwncloudDolphinPluginHelper : public QO
|
|||
public:
|
||||
static OwncloudDolphinPluginHelper *instance();
|
||||
|
||||
bool isConnected() const;
|
||||
[[nodiscard]] bool isConnected() const;
|
||||
void sendCommand(const char *data);
|
||||
QVector<QString> paths() const { return _paths; }
|
||||
[[nodiscard]] QVector<QString> paths() const { return _paths; }
|
||||
|
||||
QString contextMenuTitle() const
|
||||
[[nodiscard]] QString contextMenuTitle() const
|
||||
{
|
||||
return _strings.value("CONTEXT_MENU_TITLE", APPLICATION_NAME);
|
||||
}
|
||||
QString shareActionTitle() const
|
||||
[[nodiscard]] QString shareActionTitle() const
|
||||
{
|
||||
return _strings.value("SHARE_MENU_TITLE", "Share …");
|
||||
}
|
||||
QString contextMenuIconName() const
|
||||
[[nodiscard]] QString contextMenuIconName() const
|
||||
{
|
||||
return _strings.value("CONTEXT_MENU_ICON", APPLICATION_ICON_NAME);
|
||||
}
|
||||
|
||||
QString copyPrivateLinkTitle() const { return _strings["COPY_PRIVATE_LINK_MENU_TITLE"]; }
|
||||
QString emailPrivateLinkTitle() const { return _strings["EMAIL_PRIVATE_LINK_MENU_TITLE"]; }
|
||||
[[nodiscard]] QString copyPrivateLinkTitle() const { return _strings["COPY_PRIVATE_LINK_MENU_TITLE"]; }
|
||||
[[nodiscard]] QString emailPrivateLinkTitle() const { return _strings["EMAIL_PRIVATE_LINK_MENU_TITLE"]; }
|
||||
|
||||
QByteArray version() { return _version; }
|
||||
|
||||
|
|
|
@ -48,27 +48,27 @@ public:
|
|||
\return The number of milliseconds between animation steps. By default, the animation delay is set to 40 milliseconds.
|
||||
\sa setAnimationDelay
|
||||
*/
|
||||
int animationDelay() const { return m_delay; }
|
||||
[[nodiscard]] int animationDelay() const { return m_delay; }
|
||||
|
||||
/*! Returns a Boolean value indicating whether the component is currently animated.
|
||||
\return Animation state.
|
||||
\sa startAnimation stopAnimation
|
||||
*/
|
||||
bool isAnimated () const;
|
||||
[[nodiscard]] bool isAnimated () const;
|
||||
|
||||
/*! Returns a Boolean value indicating whether the receiver shows itself even when it is not animating.
|
||||
\return Return true if the progress indicator shows itself even when it is not animating. By default, it returns false.
|
||||
\sa setDisplayedWhenStopped
|
||||
*/
|
||||
bool isDisplayedWhenStopped() const;
|
||||
[[nodiscard]] bool isDisplayedWhenStopped() const;
|
||||
|
||||
/*! Returns the color of the component.
|
||||
\sa setColor
|
||||
*/
|
||||
const QColor & color() const { return m_color; }
|
||||
[[nodiscard]] const QColor & color() const { return m_color; }
|
||||
|
||||
QSize sizeHint() const override;
|
||||
int heightForWidth(int w) const override;
|
||||
[[nodiscard]] QSize sizeHint() const override;
|
||||
[[nodiscard]] int heightForWidth(int w) const override;
|
||||
public slots:
|
||||
/*! Starts the spin animation.
|
||||
\sa stopAnimation isAnimated
|
||||
|
|
16
src/3rdparty/kirigami/wheelhandler.h
vendored
16
src/3rdparty/kirigami/wheelhandler.h
vendored
|
@ -111,13 +111,13 @@ public:
|
|||
|
||||
void initializeFromEvent(QWheelEvent *event);
|
||||
|
||||
qreal x() const;
|
||||
qreal y() const;
|
||||
QPointF angleDelta() const;
|
||||
QPointF pixelDelta() const;
|
||||
int buttons() const;
|
||||
int modifiers() const;
|
||||
bool inverted() const;
|
||||
[[nodiscard]] qreal x() const;
|
||||
[[nodiscard]] qreal y() const;
|
||||
[[nodiscard]] QPointF angleDelta() const;
|
||||
[[nodiscard]] QPointF pixelDelta() const;
|
||||
[[nodiscard]] int buttons() const;
|
||||
[[nodiscard]] int modifiers() const;
|
||||
[[nodiscard]] bool inverted() const;
|
||||
bool isAccepted();
|
||||
void setAccepted(bool accepted);
|
||||
|
||||
|
@ -192,7 +192,7 @@ public:
|
|||
explicit WheelHandler(QObject *parent = nullptr);
|
||||
~WheelHandler() override;
|
||||
|
||||
QQuickItem *target() const;
|
||||
[[nodiscard]] QQuickItem *target() const;
|
||||
void setTarget(QQuickItem *target);
|
||||
|
||||
Q_SIGNALS:
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
void slotTimeLineChanged(qreal);
|
||||
void slotTimeLineFinished();
|
||||
|
||||
int bestContentHeight() const;
|
||||
[[nodiscard]] int bestContentHeight() const;
|
||||
};
|
||||
|
||||
void KMessageWidgetPrivate::init(KMessageWidget *q_ptr)
|
||||
|
|
20
src/3rdparty/kmessagewidget/kmessagewidget.h
vendored
20
src/3rdparty/kmessagewidget/kmessagewidget.h
vendored
|
@ -138,7 +138,7 @@ public:
|
|||
* Get the text of this message widget.
|
||||
* @see setText()
|
||||
*/
|
||||
QString text() const;
|
||||
[[nodiscard]] QString text() const;
|
||||
|
||||
/**
|
||||
* Check whether word wrap is enabled.
|
||||
|
@ -149,14 +149,14 @@ public:
|
|||
*
|
||||
* @see setWordWrap()
|
||||
*/
|
||||
bool wordWrap() const;
|
||||
[[nodiscard]] bool wordWrap() const;
|
||||
|
||||
/**
|
||||
* Check whether the close button is visible.
|
||||
*
|
||||
* @see setCloseButtonVisible()
|
||||
*/
|
||||
bool isCloseButtonVisible() const;
|
||||
[[nodiscard]] bool isCloseButtonVisible() const;
|
||||
|
||||
/**
|
||||
* Get the type of this message.
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
*
|
||||
* @see KMessageWidget::MessageType, setMessageType()
|
||||
*/
|
||||
MessageType messageType() const;
|
||||
[[nodiscard]] MessageType messageType() const;
|
||||
|
||||
/**
|
||||
* Add @p action to the message widget.
|
||||
|
@ -187,24 +187,24 @@ public:
|
|||
/**
|
||||
* Returns the preferred size of the message widget.
|
||||
*/
|
||||
QSize sizeHint() const override;
|
||||
[[nodiscard]] QSize sizeHint() const override;
|
||||
|
||||
/**
|
||||
* Returns the minimum size of the message widget.
|
||||
*/
|
||||
QSize minimumSizeHint() const override;
|
||||
[[nodiscard]] QSize minimumSizeHint() const override;
|
||||
|
||||
/**
|
||||
* Returns the required height for @p width.
|
||||
* @param width the width in pixels
|
||||
*/
|
||||
int heightForWidth(int width) const override;
|
||||
[[nodiscard]] int heightForWidth(int width) const override;
|
||||
|
||||
/**
|
||||
* The icon shown on the left of the text. By default, no icon is shown.
|
||||
* @since 4.11
|
||||
*/
|
||||
QIcon icon() const;
|
||||
[[nodiscard]] QIcon icon() const;
|
||||
|
||||
/**
|
||||
* Check whether the hide animation started by calling animatedHide()
|
||||
|
@ -214,7 +214,7 @@ public:
|
|||
* @see animatedHide(), hideAnimationFinished()
|
||||
* @since 5.0
|
||||
*/
|
||||
bool isHideAnimationRunning() const;
|
||||
[[nodiscard]] bool isHideAnimationRunning() const;
|
||||
|
||||
/**
|
||||
* Check whether the show animation started by calling animatedShow()
|
||||
|
@ -224,7 +224,7 @@ public:
|
|||
* @see animatedShow(), showAnimationFinished()
|
||||
* @since 5.0
|
||||
*/
|
||||
bool isShowAnimationRunning() const;
|
||||
[[nodiscard]] bool isShowAnimationRunning() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
|
|
4
src/3rdparty/qtlockedfile/qtlockedfile.h
vendored
4
src/3rdparty/qtlockedfile/qtlockedfile.h
vendored
|
@ -61,8 +61,8 @@ public:
|
|||
|
||||
bool lock(LockMode mode, bool block = true);
|
||||
bool unlock();
|
||||
bool isLocked() const;
|
||||
LockMode lockMode() const;
|
||||
[[nodiscard]] bool isLocked() const;
|
||||
[[nodiscard]] LockMode lockMode() const;
|
||||
|
||||
private:
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
8
src/3rdparty/qtokenizer/qtokenizer.h
vendored
8
src/3rdparty/qtokenizer/qtokenizer.h
vendored
|
@ -71,11 +71,11 @@ struct QTokenizerPrivate {
|
|||
{
|
||||
}
|
||||
|
||||
bool isDelimiter(char_type c) const {
|
||||
[[nodiscard]] bool isDelimiter(char_type c) const {
|
||||
return delimiters.contains(c);
|
||||
}
|
||||
|
||||
bool isQuote(char_type c) const {
|
||||
[[nodiscard]] bool isQuote(char_type c) const {
|
||||
return quotes.contains(c);
|
||||
}
|
||||
|
||||
|
@ -212,14 +212,14 @@ public:
|
|||
Returns true if the current token is a delimiter,
|
||||
if one more more delimiting characters have been set.
|
||||
*/
|
||||
bool isDelimiter() const { return d->isDelim; }
|
||||
[[nodiscard]] bool isDelimiter() const { return d->isDelim; }
|
||||
|
||||
/*!
|
||||
Returns the current token.
|
||||
|
||||
Use \c hasNext() to fetch the next token.
|
||||
*/
|
||||
T next() const {
|
||||
[[nodiscard]] T next() const {
|
||||
int len = std::distance(d->tokenBegin, d->tokenEnd);
|
||||
const_iterator tmpStart = d->tokenBegin;
|
||||
if (!d->returnQuotes && len > 1 && d->isQuote(*d->tokenBegin)) {
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
explicit QtLocalPeer(QObject *parent = nullptr, const QString &appId = QString());
|
||||
bool isClient();
|
||||
bool sendMessage(const QString &message, int timeout, bool block);
|
||||
QString applicationId() const
|
||||
[[nodiscard]] QString applicationId() const
|
||||
{ return id; }
|
||||
static QString appSessionId(const QString &appId);
|
||||
|
||||
|
|
|
@ -49,9 +49,9 @@ public:
|
|||
bool isRunning(qint64 pid = -1);
|
||||
|
||||
void setActivationWindow(QWidget* aw, bool activateOnMessage = true);
|
||||
QWidget* activationWindow() const;
|
||||
[[nodiscard]] QWidget* activationWindow() const;
|
||||
|
||||
QString applicationId() const;
|
||||
[[nodiscard]] QString applicationId() const;
|
||||
void setBlock(bool value);
|
||||
|
||||
public Q_SLOTS:
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
QtSingleCoreApplication(const QString &id, int &argc, char **argv);
|
||||
|
||||
bool isRunning();
|
||||
QString id() const;
|
||||
[[nodiscard]] QString id() const;
|
||||
void setBlock(bool value);
|
||||
|
||||
public Q_SLOTS:
|
||||
|
|
|
@ -169,8 +169,8 @@ public:
|
|||
*/
|
||||
void start(std::unique_ptr<QIODevice> device, const QByteArray &checksumHeader);
|
||||
|
||||
QByteArray calculatedChecksumType() const;
|
||||
QByteArray calculatedChecksum() const;
|
||||
[[nodiscard]] QByteArray calculatedChecksumType() const;
|
||||
[[nodiscard]] QByteArray calculatedChecksum() const;
|
||||
|
||||
signals:
|
||||
void validated(const QByteArray &checksumType, const QByteArray &checksum);
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
bool transaction();
|
||||
bool commit();
|
||||
void close();
|
||||
QString error() const;
|
||||
[[nodiscard]] QString error() const;
|
||||
sqlite3 *sqliteDb();
|
||||
|
||||
private:
|
||||
|
@ -111,8 +111,8 @@ public:
|
|||
int prepare(const QByteArray &sql, bool allow_failure = false);
|
||||
|
||||
~SqlQuery();
|
||||
QString error() const;
|
||||
int errorId() const;
|
||||
[[nodiscard]] QString error() const;
|
||||
[[nodiscard]] int errorId() const;
|
||||
|
||||
/// Checks whether the value at the given column index is NULL
|
||||
bool nullValue(int index);
|
||||
|
@ -152,7 +152,7 @@ public:
|
|||
bindValueInternal(pos, value);
|
||||
}
|
||||
|
||||
const QByteArray &lastQuery() const;
|
||||
[[nodiscard]] const QByteArray &lastQuery() const;
|
||||
int numRowsAffected();
|
||||
void reset_and_clear_bindings();
|
||||
|
||||
|
|
|
@ -63,10 +63,10 @@ public:
|
|||
RemotePermissions() = default;
|
||||
|
||||
/// array with one character per permission, "" is null, " " is non-null but empty
|
||||
QByteArray toDbValue() const;
|
||||
[[nodiscard]] QByteArray toDbValue() const;
|
||||
|
||||
/// output for display purposes, no defined format (same as toDbValue in practice)
|
||||
QString toString() const;
|
||||
[[nodiscard]] QString toString() const;
|
||||
|
||||
/// read value that was written with toDbValue()
|
||||
static RemotePermissions fromDbValue(const QByteArray &);
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
/// read a permissions string received from the server, never null
|
||||
static RemotePermissions fromServerString(const QString &);
|
||||
|
||||
bool hasPermission(Permissions p) const
|
||||
[[nodiscard]] bool hasPermission(Permissions p) const
|
||||
{
|
||||
return _value & (1 << static_cast<int>(p));
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
_value &= ~(1 << static_cast<int>(p));
|
||||
}
|
||||
|
||||
bool isNull() const { return !(_value & notNullMask); }
|
||||
[[nodiscard]] bool isNull() const { return !(_value & notNullMask); }
|
||||
friend bool operator==(RemotePermissions a, RemotePermissions b)
|
||||
{
|
||||
return a._value == b._value;
|
||||
|
|
|
@ -117,13 +117,13 @@ public:
|
|||
return &_result;
|
||||
}
|
||||
|
||||
const T &get() const
|
||||
[[nodiscard]] const T &get() const
|
||||
{
|
||||
ASSERT(!_isError)
|
||||
return _result;
|
||||
}
|
||||
|
||||
const Error &error() const &
|
||||
[[nodiscard]] const Error &error() const &
|
||||
{
|
||||
ASSERT(_isError);
|
||||
return _error;
|
||||
|
@ -134,7 +134,7 @@ public:
|
|||
return std::move(_error);
|
||||
}
|
||||
|
||||
bool isValid() const { return !_isError; }
|
||||
[[nodiscard]] bool isValid() const { return !_isError; }
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
|
|
|
@ -43,12 +43,12 @@ public:
|
|||
SyncFileStatus(SyncFileStatusTag);
|
||||
|
||||
void set(SyncFileStatusTag tag);
|
||||
SyncFileStatusTag tag() const;
|
||||
[[nodiscard]] SyncFileStatusTag tag() const;
|
||||
|
||||
void setShared(bool isShared);
|
||||
bool shared() const;
|
||||
[[nodiscard]] bool shared() const;
|
||||
|
||||
QString toSocketAPIString() const;
|
||||
[[nodiscard]] QString toSocketAPIString() const;
|
||||
|
||||
private:
|
||||
SyncFileStatusTag _tag = StatusNone;
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
bool exists();
|
||||
void walCheckpoint();
|
||||
|
||||
QString databaseFilePath() const;
|
||||
[[nodiscard]] QString databaseFilePath() const;
|
||||
|
||||
static qint64 getPHash(const QByteArray &);
|
||||
|
||||
|
@ -124,7 +124,7 @@ public:
|
|||
* (As opposed to a small file transfer which is stored in the db so we can detect the case
|
||||
* when the upload succeeded, but the connection was dropped before we got the answer)
|
||||
*/
|
||||
bool isChunked() const { return _transferid != 0; }
|
||||
[[nodiscard]] bool isChunked() const { return _transferid != 0; }
|
||||
};
|
||||
|
||||
struct PollInfo
|
||||
|
|
|
@ -48,7 +48,7 @@ struct SyncJournalFileLockInfo {
|
|||
class OCSYNC_EXPORT SyncJournalFileRecord
|
||||
{
|
||||
public:
|
||||
bool isValid() const
|
||||
[[nodiscard]] bool isValid() const
|
||||
{
|
||||
return !_path.isEmpty();
|
||||
}
|
||||
|
@ -59,14 +59,14 @@ public:
|
|||
*
|
||||
* It is used in the construction of private links.
|
||||
*/
|
||||
QByteArray numericFileId() const;
|
||||
QDateTime modDateTime() const { return Utility::qDateTimeFromTime_t(_modtime); }
|
||||
[[nodiscard]] QByteArray numericFileId() const;
|
||||
[[nodiscard]] QDateTime modDateTime() const { return Utility::qDateTimeFromTime_t(_modtime); }
|
||||
|
||||
bool isDirectory() const { return _type == ItemTypeDirectory; }
|
||||
bool isFile() const { return _type == ItemTypeFile || _type == ItemTypeVirtualFileDehydration; }
|
||||
bool isVirtualFile() const { return _type == ItemTypeVirtualFile || _type == ItemTypeVirtualFileDownload; }
|
||||
QString path() const { return QString::fromUtf8(_path); }
|
||||
QString e2eMangledName() const { return QString::fromUtf8(_e2eMangledName); }
|
||||
[[nodiscard]] bool isDirectory() const { return _type == ItemTypeDirectory; }
|
||||
[[nodiscard]] bool isFile() const { return _type == ItemTypeFile || _type == ItemTypeVirtualFileDehydration; }
|
||||
[[nodiscard]] bool isVirtualFile() const { return _type == ItemTypeVirtualFile || _type == ItemTypeVirtualFileDownload; }
|
||||
[[nodiscard]] QString path() const { return QString::fromUtf8(_path); }
|
||||
[[nodiscard]] QString e2eMangledName() const { return QString::fromUtf8(_e2eMangledName); }
|
||||
|
||||
QByteArray _path;
|
||||
quint64 _inode = 0;
|
||||
|
@ -120,7 +120,7 @@ public:
|
|||
/// The last X-Request-ID of the request that failled
|
||||
QByteArray _requestId;
|
||||
|
||||
bool isValid() const;
|
||||
[[nodiscard]] bool isValid() const;
|
||||
};
|
||||
|
||||
/** Represents a conflict in the conflicts table.
|
||||
|
@ -165,7 +165,7 @@ public:
|
|||
QByteArray initialBasePath;
|
||||
|
||||
|
||||
bool isValid() const { return !path.isEmpty(); }
|
||||
[[nodiscard]] bool isValid() const { return !path.isEmpty(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ namespace {
|
|||
const char *name;
|
||||
quint64 msec;
|
||||
|
||||
QString description(quint64 value) const
|
||||
[[nodiscard]] QString description(quint64 value) const
|
||||
{
|
||||
return QCoreApplication::translate("Utility", name, nullptr, value);
|
||||
}
|
||||
|
|
|
@ -185,9 +185,9 @@ namespace Utility {
|
|||
void reset();
|
||||
|
||||
// out helpers, return the measured times.
|
||||
QDateTime startTime() const;
|
||||
QDateTime timeOfLap(const QString &lapName) const;
|
||||
quint64 durationOfLap(const QString &lapName) const;
|
||||
[[nodiscard]] QDateTime startTime() const;
|
||||
[[nodiscard]] QDateTime timeOfLap(const QString &lapName) const;
|
||||
[[nodiscard]] quint64 durationOfLap(const QString &lapName) const;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -131,13 +131,13 @@ public:
|
|||
explicit Vfs(QObject* parent = nullptr);
|
||||
~Vfs() override;
|
||||
|
||||
virtual Mode mode() const = 0;
|
||||
[[nodiscard]] virtual Mode mode() const = 0;
|
||||
|
||||
/// For WithSuffix modes: the suffix (including the dot)
|
||||
virtual QString fileSuffix() const = 0;
|
||||
[[nodiscard]] virtual QString fileSuffix() const = 0;
|
||||
|
||||
/// Access to the parameters the instance was start()ed with.
|
||||
const VfsSetupParams ¶ms() const { return _setupParams; }
|
||||
[[nodiscard]] const VfsSetupParams ¶ms() const { return _setupParams; }
|
||||
|
||||
|
||||
/** Initializes interaction with the VFS provider.
|
||||
|
@ -158,13 +158,13 @@ public:
|
|||
* Some plugins might provide alternate shell integration, making the normal
|
||||
* context menu actions redundant.
|
||||
*/
|
||||
virtual bool socketApiPinStateActionsShown() const = 0;
|
||||
[[nodiscard]] virtual bool socketApiPinStateActionsShown() const = 0;
|
||||
|
||||
/** Return true when download of a file's data is currently ongoing.
|
||||
*
|
||||
* See also the beginHydrating() and doneHydrating() signals.
|
||||
*/
|
||||
virtual bool isHydrating() const = 0;
|
||||
[[nodiscard]] virtual bool isHydrating() const = 0;
|
||||
|
||||
/** Update placeholder metadata during discovery.
|
||||
*
|
||||
|
@ -296,15 +296,15 @@ public:
|
|||
VfsOff(QObject* parent = nullptr);
|
||||
~VfsOff() override;
|
||||
|
||||
Mode mode() const override { return Vfs::Off; }
|
||||
[[nodiscard]] Mode mode() const override { return Vfs::Off; }
|
||||
|
||||
QString fileSuffix() const override { return QString(); }
|
||||
[[nodiscard]] QString fileSuffix() const override { return QString(); }
|
||||
|
||||
void stop() override {}
|
||||
void unregisterFolder() override {}
|
||||
|
||||
bool socketApiPinStateActionsShown() const override { return false; }
|
||||
bool isHydrating() const override { return false; }
|
||||
[[nodiscard]] bool socketApiPinStateActionsShown() const override { return false; }
|
||||
[[nodiscard]] bool isHydrating() const override { return false; }
|
||||
|
||||
Result<void, QString> updateMetadata(const QString &, time_t, qint64, const QByteArray &) override { return {}; }
|
||||
Result<void, QString> createPlaceholder(const SyncFileItem &) override { return {}; }
|
||||
|
|
|
@ -94,7 +94,7 @@ public:
|
|||
* @param filePath the absolute path to the file
|
||||
* @param basePath folder path from which to apply exclude rules, ends with a /
|
||||
*/
|
||||
bool isExcluded(
|
||||
[[nodiscard]] bool isExcluded(
|
||||
const QString &filePath,
|
||||
const QString &basePath,
|
||||
bool excludeHidden) const;
|
||||
|
@ -168,7 +168,7 @@ private:
|
|||
*
|
||||
* Would enable the "myexclude" pattern only for versions before 2.5.0.
|
||||
*/
|
||||
bool versionDirectiveKeepNextLine(const QByteArray &directive) const;
|
||||
[[nodiscard]] bool versionDirectiveKeepNextLine(const QByteArray &directive) const;
|
||||
|
||||
/**
|
||||
* @brief Match the exclude pattern against the full path.
|
||||
|
@ -178,7 +178,7 @@ private:
|
|||
* Note that this only matches patterns. It does not check whether the file
|
||||
* or directory pointed to is hidden (or whether it even exists).
|
||||
*/
|
||||
CSYNC_EXCLUDE_TYPE fullPatternMatch(const QString &path, ItemType filetype) const;
|
||||
[[nodiscard]] CSYNC_EXCLUDE_TYPE fullPatternMatch(const QString &path, ItemType filetype) const;
|
||||
|
||||
// Our BasePath need to end with '/'
|
||||
class BasePathString : public QString
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
* Return a list of all accounts.
|
||||
* (this is a list of QSharedPointer for internal reasons, one should normally not keep a copy of them)
|
||||
*/
|
||||
QList<AccountStatePtr> accounts() const;
|
||||
[[nodiscard]] QList<AccountStatePtr> accounts() const;
|
||||
|
||||
/**
|
||||
* Return the account state pointer for an account identified by its display name
|
||||
|
@ -89,8 +89,8 @@ private:
|
|||
|
||||
bool restoreFromLegacySettings();
|
||||
|
||||
bool isAccountIdAvailable(const QString &id) const;
|
||||
QString generateFreeAccountId() const;
|
||||
[[nodiscard]] bool isAccountIdAvailable(const QString &id) const;
|
||||
[[nodiscard]] QString generateFreeAccountId() const;
|
||||
|
||||
// Adds an account to the tracked list, emitting accountAdded()
|
||||
void addAccountState(AccountState *accountState);
|
||||
|
|
|
@ -56,7 +56,7 @@ class AccountSettings : public QWidget
|
|||
public:
|
||||
explicit AccountSettings(AccountState *accountState, QWidget *parent = nullptr);
|
||||
~AccountSettings() override;
|
||||
QSize sizeHint() const override { return ownCloudGui::settingsDialogSize(); }
|
||||
[[nodiscard]] QSize sizeHint() const override { return ownCloudGui::settingsDialogSize(); }
|
||||
bool canEncryptOrDecrypt(const FolderStatusModel::SubFolderInfo* folderInfo);
|
||||
|
||||
signals:
|
||||
|
@ -120,7 +120,7 @@ private:
|
|||
void customizeStyle();
|
||||
|
||||
/// Returns the alias of the selected folder, empty string if none
|
||||
QString selectedFolderAlias() const;
|
||||
[[nodiscard]] QString selectedFolderAlias() const;
|
||||
|
||||
Ui::AccountSettings *_ui;
|
||||
|
||||
|
|
|
@ -271,10 +271,10 @@ public:
|
|||
const QString &id, const QUrl &iconUrl,
|
||||
QObject* parent = nullptr);
|
||||
|
||||
QString name() const;
|
||||
QUrl url() const;
|
||||
QString id() const;
|
||||
QUrl iconUrl() const;
|
||||
[[nodiscard]] QString name() const;
|
||||
[[nodiscard]] QUrl url() const;
|
||||
[[nodiscard]] QString id() const;
|
||||
[[nodiscard]] QUrl iconUrl() const;
|
||||
|
||||
private:
|
||||
QString _name;
|
||||
|
|
|
@ -64,13 +64,13 @@ public:
|
|||
void showHelp();
|
||||
void showHint(std::string errorHint);
|
||||
bool debugMode();
|
||||
bool backgroundMode() const;
|
||||
[[nodiscard]] bool backgroundMode() const;
|
||||
bool versionOnly(); // only display the version?
|
||||
void showVersion();
|
||||
|
||||
void showMainDialog();
|
||||
|
||||
ownCloudGui *gui() const;
|
||||
[[nodiscard]] ownCloudGui *gui() const;
|
||||
|
||||
bool event(QEvent *event) override;
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ class AuthenticationDialog : public QDialog
|
|||
public:
|
||||
AuthenticationDialog(const QString &realm, const QString &domain, QWidget *parent = nullptr);
|
||||
|
||||
QString user() const;
|
||||
QString password() const;
|
||||
[[nodiscard]] QString user() const;
|
||||
[[nodiscard]] QString password() const;
|
||||
|
||||
private:
|
||||
QLineEdit *_user;
|
||||
|
|
|
@ -32,9 +32,9 @@ class CallStateChecker : public QObject
|
|||
public:
|
||||
explicit CallStateChecker(QObject *parent = nullptr);
|
||||
|
||||
QString token() const;
|
||||
AccountState* accountState() const;
|
||||
bool checking() const;
|
||||
[[nodiscard]] QString token() const;
|
||||
[[nodiscard]] AccountState* accountState() const;
|
||||
[[nodiscard]] bool checking() const;
|
||||
|
||||
signals:
|
||||
void tokenChanged();
|
||||
|
@ -57,7 +57,7 @@ private slots:
|
|||
private:
|
||||
void setup();
|
||||
void startCallStateCheck();
|
||||
bool isAccountServerVersion22OrLater() const;
|
||||
[[nodiscard]] bool isAccountServerVersion22OrLater() const;
|
||||
|
||||
AccountState *_accountState = nullptr;
|
||||
QString _token;
|
||||
|
|
|
@ -32,9 +32,9 @@ public:
|
|||
explicit ConflictDialog(QWidget *parent = nullptr);
|
||||
~ConflictDialog() override;
|
||||
|
||||
QString baseFilename() const;
|
||||
QString localVersionFilename() const;
|
||||
QString remoteVersionFilename() const;
|
||||
[[nodiscard]] QString baseFilename() const;
|
||||
[[nodiscard]] QString localVersionFilename() const;
|
||||
[[nodiscard]] QString remoteVersionFilename() const;
|
||||
|
||||
public slots:
|
||||
void setBaseFilename(const QString &baseFilename);
|
||||
|
|
|
@ -35,8 +35,8 @@ public:
|
|||
|
||||
explicit ConflictSolver(QWidget *parent = nullptr);
|
||||
|
||||
QString localVersionFilename() const;
|
||||
QString remoteVersionFilename() const;
|
||||
[[nodiscard]] QString localVersionFilename() const;
|
||||
[[nodiscard]] QString remoteVersionFilename() const;
|
||||
|
||||
bool exec(Solution solution);
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
void start();
|
||||
void openBrowser();
|
||||
void copyLinkToClipboard();
|
||||
QUrl authorisationLink() const;
|
||||
[[nodiscard]] QUrl authorisationLink() const;
|
||||
|
||||
signals:
|
||||
/**
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
* In case of oauth, return an URL to the link to open the browser.
|
||||
* An invalid URL otherwise
|
||||
*/
|
||||
QUrl authorisationLink() const { return _asyncAuth ? _asyncAuth->authorisationLink() : QUrl(); }
|
||||
[[nodiscard]] QUrl authorisationLink() const { return _asyncAuth ? _asyncAuth->authorisationLink() : QUrl(); }
|
||||
|
||||
|
||||
static QString requestAppPasswordText(const Account *account);
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
Q_ENUM(Result);
|
||||
void start();
|
||||
bool openBrowser();
|
||||
QUrl authorisationLink() const;
|
||||
[[nodiscard]] QUrl authorisationLink() const;
|
||||
|
||||
signals:
|
||||
/**
|
||||
|
|
|
@ -43,12 +43,12 @@ public:
|
|||
const QSslKey &key = QSslKey(),
|
||||
const QList<QSslCertificate> &caCertificates = QList<QSslCertificate>());
|
||||
|
||||
QString authType() const override;
|
||||
QString user() const override;
|
||||
QString password() const override;
|
||||
QNetworkAccessManager *createQNAM() const override;
|
||||
[[nodiscard]] QString authType() const override;
|
||||
[[nodiscard]] QString user() const override;
|
||||
[[nodiscard]] QString password() const override;
|
||||
[[nodiscard]] QNetworkAccessManager *createQNAM() const override;
|
||||
|
||||
bool ready() const override;
|
||||
[[nodiscard]] bool ready() const override;
|
||||
|
||||
void fetchFromKeychain() override;
|
||||
void askFromUser() override;
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
void setInfo(const QString &msg);
|
||||
void setError(const QString &error);
|
||||
|
||||
bool isUsingFlow2() const {
|
||||
[[nodiscard]] bool isUsingFlow2() const {
|
||||
return _useFlow2;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@ public:
|
|||
explicit ElidedLabel(const QString &text, QWidget *parent = nullptr);
|
||||
|
||||
void setText(const QString &text);
|
||||
const QString &text() const { return _text; }
|
||||
[[nodiscard]] const QString &text() const { return _text; }
|
||||
|
||||
void setElideMode(Qt::TextElideMode elideMode);
|
||||
Qt::TextElideMode elideMode() const { return _elideMode; }
|
||||
[[nodiscard]] Qt::TextElideMode elideMode() const { return _elideMode; }
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
|
|
@ -62,9 +62,9 @@ struct Emoji
|
|||
class EmojiCategoriesModel : public QAbstractListModel
|
||||
{
|
||||
public:
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
[[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
|
||||
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
private:
|
||||
enum Roles {
|
||||
|
@ -105,11 +105,11 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
Q_INVOKABLE QVariantList history() const;
|
||||
Q_INVOKABLE [[nodiscard]] QVariantList history() const;
|
||||
Q_INVOKABLE void setCategory(const QString &category);
|
||||
Q_INVOKABLE void emojiUsed(const QVariant &modelData);
|
||||
|
||||
QVariantList model() const;
|
||||
[[nodiscard]] QVariantList model() const;
|
||||
QAbstractListModel *emojiCategoriesModel();
|
||||
|
||||
signals:
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
static QString prepareTargetPath(const QString &path);
|
||||
|
||||
/// journalPath relative to localPath.
|
||||
QString absoluteJournalPath() const;
|
||||
[[nodiscard]] QString absoluteJournalPath() const;
|
||||
|
||||
/// Returns the relative journal path that's appropriate for this folder and account.
|
||||
QString defaultJournalPath(AccountPtr account);
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
*/
|
||||
static void backwardMigrationSettingsKeys(QStringList *deleteKeys, QStringList *ignoreKeys);
|
||||
|
||||
const Folder::Map &map() const;
|
||||
[[nodiscard]] const Folder::Map &map() const;
|
||||
|
||||
/** Adds a folder for an account, ensures the journal is gone and saves it in the settings.
|
||||
*/
|
||||
|
@ -144,7 +144,7 @@ public:
|
|||
*
|
||||
* @returns an empty string and PathValidityResult::Valid if it is allowed, or an error if it is not allowed
|
||||
*/
|
||||
QPair<PathValidityResult, QString> checkPathValidityForNewFolder(const QString &path, const QUrl &serverUrl = QUrl()) const;
|
||||
[[nodiscard]] QPair<PathValidityResult, QString> checkPathValidityForNewFolder(const QString &path, const QUrl &serverUrl = QUrl()) const;
|
||||
|
||||
/**
|
||||
* Attempts to find a non-existing, acceptable path for creating a new sync folder.
|
||||
|
@ -155,7 +155,7 @@ public:
|
|||
* subfolder of ~ would be a good candidate. When that happens \a basePath
|
||||
* is returned.
|
||||
*/
|
||||
QString findGoodPathForNewSyncFolder(const QString &basePath, const QUrl &serverUrl) const;
|
||||
[[nodiscard]] QString findGoodPathForNewSyncFolder(const QString &basePath, const QUrl &serverUrl) const;
|
||||
|
||||
/**
|
||||
* While ignoring hidden files can theoretically be switched per folder,
|
||||
|
@ -163,13 +163,13 @@ public:
|
|||
* at once.
|
||||
* These helper functions can be removed once it's properly per-folder.
|
||||
*/
|
||||
bool ignoreHiddenFiles() const;
|
||||
[[nodiscard]] bool ignoreHiddenFiles() const;
|
||||
void setIgnoreHiddenFiles(bool ignore);
|
||||
|
||||
/**
|
||||
* Access to the current queue of scheduled folders.
|
||||
*/
|
||||
QQueue<Folder *> scheduleQueue() const;
|
||||
[[nodiscard]] QQueue<Folder *> scheduleQueue() const;
|
||||
|
||||
/**
|
||||
* Access to the currently syncing folder.
|
||||
|
@ -179,7 +179,7 @@ public:
|
|||
*
|
||||
* See also isAnySyncRunning()
|
||||
*/
|
||||
Folder *currentSyncFolder() const;
|
||||
[[nodiscard]] Folder *currentSyncFolder() const;
|
||||
|
||||
/**
|
||||
* Returns true if any folder is currently syncing.
|
||||
|
@ -187,7 +187,7 @@ public:
|
|||
* This might be a FolderMan-scheduled sync, or a externally
|
||||
* managed sync like a placeholder hydration.
|
||||
*/
|
||||
bool isAnySyncRunning() const;
|
||||
[[nodiscard]] bool isAnySyncRunning() const;
|
||||
|
||||
/** Removes all folders */
|
||||
int unloadAndDeleteAllFolders();
|
||||
|
@ -324,7 +324,7 @@ private:
|
|||
|
||||
// finds all folder configuration files
|
||||
// and create the folders
|
||||
QString getBackupName(QString fullPathName) const;
|
||||
[[nodiscard]] QString getBackupName(QString fullPathName) const;
|
||||
|
||||
// makes the folder known to the socket api
|
||||
void registerFolderWithSocketApi(Folder *folder);
|
||||
|
@ -339,7 +339,7 @@ private:
|
|||
|
||||
bool pushNotificationsFilesReady(Account *account);
|
||||
|
||||
bool isSwitchToVfsNeeded(const FolderDefinition &folderDefinition) const;
|
||||
[[nodiscard]] bool isSwitchToVfsNeeded(const FolderDefinition &folderDefinition) const;
|
||||
|
||||
QSet<Folder *> _disabledFolders;
|
||||
Folder::Map _folderMap;
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
|
||||
};
|
||||
void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override;
|
||||
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override;
|
||||
[[nodiscard]] QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override;
|
||||
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) override;
|
||||
|
||||
|
|
|
@ -45,17 +45,17 @@ public:
|
|||
~FolderStatusModel() override;
|
||||
void setAccountState(const AccountState *accountState);
|
||||
|
||||
Qt::ItemFlags flags(const QModelIndex &) const override;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
[[nodiscard]] Qt::ItemFlags flags(const QModelIndex &) const override;
|
||||
[[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override;
|
||||
QModelIndex parent(const QModelIndex &child) const override;
|
||||
bool canFetchMore(const QModelIndex &parent) const override;
|
||||
[[nodiscard]] int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] QModelIndex parent(const QModelIndex &child) const override;
|
||||
[[nodiscard]] bool canFetchMore(const QModelIndex &parent) const override;
|
||||
void fetchMore(const QModelIndex &parent) override;
|
||||
void resetAndFetch(const QModelIndex &parent);
|
||||
bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
struct SubFolderInfo
|
||||
{
|
||||
|
@ -81,14 +81,14 @@ public:
|
|||
Qt::CheckState _checked = Qt::Checked;
|
||||
|
||||
// Whether this has a FetchLabel subrow
|
||||
bool hasLabel() const;
|
||||
[[nodiscard]] bool hasLabel() const;
|
||||
|
||||
// Reset all subfolders and fetch status
|
||||
void resetSubs(FolderStatusModel *model, QModelIndex index);
|
||||
|
||||
struct Progress
|
||||
{
|
||||
bool isNull() const
|
||||
[[nodiscard]] bool isNull() const
|
||||
{
|
||||
return _progressString.isEmpty() && _warningCount == 0 && _overallSyncString.isEmpty();
|
||||
}
|
||||
|
@ -106,9 +106,9 @@ public:
|
|||
SubFolder,
|
||||
AddButton,
|
||||
FetchLabel };
|
||||
ItemType classify(const QModelIndex &index) const;
|
||||
SubFolderInfo *infoForIndex(const QModelIndex &index) const;
|
||||
bool isAnyAncestorEncrypted(const QModelIndex &index) const;
|
||||
[[nodiscard]] ItemType classify(const QModelIndex &index) const;
|
||||
[[nodiscard]] SubFolderInfo *infoForIndex(const QModelIndex &index) const;
|
||||
[[nodiscard]] bool isAnyAncestorEncrypted(const QModelIndex &index) const;
|
||||
// If the selective sync check boxes were changed
|
||||
bool isDirty() { return _dirty; }
|
||||
|
||||
|
@ -142,7 +142,7 @@ private slots:
|
|||
void slotShowFetchProgress();
|
||||
|
||||
private:
|
||||
QStringList createBlackList(const OCC::FolderStatusModel::SubFolderInfo &root,
|
||||
[[nodiscard]] QStringList createBlackList(const OCC::FolderStatusModel::SubFolderInfo &root,
|
||||
const QStringList &oldBlackList) const;
|
||||
const AccountState *_accountState = nullptr;
|
||||
bool _dirty = false; // If the selective sync checkboxes were changed
|
||||
|
|
|
@ -30,8 +30,8 @@ class FolderStatusView : public QTreeView
|
|||
public:
|
||||
explicit FolderStatusView(QWidget *parent = nullptr);
|
||||
|
||||
QModelIndex indexAt(const QPoint &point) const override;
|
||||
QRect visualRect(const QModelIndex &index) const override;
|
||||
[[nodiscard]] QModelIndex indexAt(const QPoint &point) const override;
|
||||
[[nodiscard]] QRect visualRect(const QModelIndex &index) const override;
|
||||
};
|
||||
|
||||
} // namespace OCC
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
* For example, this can happen on linux if the inotify user limit from
|
||||
* /proc/sys/fs/inotify/max_user_watches is exceeded.
|
||||
*/
|
||||
bool isReliable() const;
|
||||
[[nodiscard]] bool isReliable() const;
|
||||
|
||||
/**
|
||||
* Triggers a change in the path and verifies a notification arrives.
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
void startNotificatonTest(const QString &path);
|
||||
|
||||
/// For testing linux behavior only
|
||||
int testLinuxWatchCount() const;
|
||||
[[nodiscard]] int testLinuxWatchCount() const;
|
||||
|
||||
signals:
|
||||
/** Emitted when one of the watched directories or one
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
FolderWatcherPrivate(FolderWatcher *p, const QString &path);
|
||||
~FolderWatcherPrivate() override;
|
||||
|
||||
int testWatchCount() const { return _pathToWatch.size(); }
|
||||
[[nodiscard]] int testWatchCount() const { return _pathToWatch.size(); }
|
||||
|
||||
/// On linux the watcher is ready when the ctor finished.
|
||||
bool _ready = true;
|
||||
|
|
|
@ -41,7 +41,7 @@ class FormatWarningsWizardPage : public QWizardPage
|
|||
{
|
||||
Q_OBJECT
|
||||
protected:
|
||||
QString formatWarnings(const QStringList &warnings) const;
|
||||
[[nodiscard]] QString formatWarnings(const QStringList &warnings) const;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -55,7 +55,7 @@ public:
|
|||
explicit FolderWizardLocalPath(const AccountPtr &account);
|
||||
~FolderWizardLocalPath() override;
|
||||
|
||||
bool isComplete() const override;
|
||||
[[nodiscard]] bool isComplete() const override;
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
|
||||
|
@ -88,7 +88,7 @@ public:
|
|||
explicit FolderWizardRemotePath(const AccountPtr &account);
|
||||
~FolderWizardRemotePath() override;
|
||||
|
||||
bool isComplete() const override;
|
||||
[[nodiscard]] bool isComplete() const override;
|
||||
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
|
|
|
@ -39,7 +39,7 @@ class GeneralSettings : public QWidget
|
|||
public:
|
||||
explicit GeneralSettings(QWidget *parent = nullptr);
|
||||
~GeneralSettings() override;
|
||||
QSize sizeHint() const override;
|
||||
[[nodiscard]] QSize sizeHint() const override;
|
||||
|
||||
public slots:
|
||||
void slotStyleChanged();
|
||||
|
|
|
@ -29,7 +29,7 @@ class NavigationPaneHelper : public QObject
|
|||
public:
|
||||
NavigationPaneHelper(FolderMan *folderMan);
|
||||
|
||||
bool showInExplorerNavigationPane() const { return _showInExplorerNavigationPane; }
|
||||
[[nodiscard]] bool showInExplorerNavigationPane() const { return _showInExplorerNavigationPane; }
|
||||
void setShowInExplorerNavigationPane(bool show);
|
||||
|
||||
void scheduleUpdateCloudStorageRegistry();
|
||||
|
|
|
@ -35,7 +35,7 @@ class NetworkSettings : public QWidget
|
|||
public:
|
||||
explicit NetworkSettings(QWidget *parent = nullptr);
|
||||
~NetworkSettings() override;
|
||||
QSize sizeHint() const override;
|
||||
[[nodiscard]] QSize sizeHint() const override;
|
||||
|
||||
private slots:
|
||||
void saveProxySettings();
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
explicit PasswordInputDialog(const QString &description, const QString &error, QWidget *parent = nullptr);
|
||||
~PasswordInputDialog() override;
|
||||
|
||||
QString password() const;
|
||||
[[nodiscard]] QString password() const;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::PasswordInputDialog> _ui;
|
||||
|
|
|
@ -38,8 +38,8 @@ public:
|
|||
|
||||
void setProxyAddress(const QString &address);
|
||||
|
||||
QString username() const;
|
||||
QString password() const;
|
||||
[[nodiscard]] QString username() const;
|
||||
[[nodiscard]] QString password() const;
|
||||
|
||||
/// Resets the dialog for new credential entry.
|
||||
void reset();
|
||||
|
|
|
@ -77,8 +77,8 @@ private:
|
|||
int &counter,
|
||||
const QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents);
|
||||
|
||||
QString keychainUsernameKey() const;
|
||||
QString keychainPasswordKey() const;
|
||||
[[nodiscard]] QString keychainUsernameKey() const;
|
||||
[[nodiscard]] QString keychainPasswordKey() const;
|
||||
|
||||
/// The hostname:port of the current proxy, used for detecting switches
|
||||
/// to a different proxy.
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
/** Returns the oldBlackList passed into setFolderInfo(), except that
|
||||
* a "/" entry is expanded to all top-level folder names.
|
||||
*/
|
||||
QStringList oldBlackList() const;
|
||||
[[nodiscard]] QStringList oldBlackList() const;
|
||||
|
||||
// Estimates the total size of checked items (recursively)
|
||||
qint64 estimatedSize(QTreeWidgetItem *root = nullptr);
|
||||
|
@ -52,7 +52,7 @@ public:
|
|||
void setFolderInfo(const QString &folderPath, const QString &rootName,
|
||||
const QStringList &oldBlackList = QStringList());
|
||||
|
||||
QSize sizeHint() const override;
|
||||
[[nodiscard]] QSize sizeHint() const override;
|
||||
|
||||
private slots:
|
||||
void slotUpdateDirectories(QStringList);
|
||||
|
@ -102,8 +102,8 @@ public:
|
|||
|
||||
void accept() override;
|
||||
|
||||
QStringList createBlackList() const;
|
||||
QStringList oldBlackList() const;
|
||||
[[nodiscard]] QStringList createBlackList() const;
|
||||
[[nodiscard]] QStringList oldBlackList() const;
|
||||
|
||||
// Estimate the size of the total of sync'ed files from the server
|
||||
qint64 estimatedSize();
|
||||
|
|
|
@ -50,10 +50,10 @@ public:
|
|||
const QString displayName,
|
||||
const Type type);
|
||||
|
||||
QString format() const;
|
||||
QString shareWith() const;
|
||||
QString displayName() const;
|
||||
Type type() const;
|
||||
[[nodiscard]] QString format() const;
|
||||
[[nodiscard]] QString shareWith() const;
|
||||
[[nodiscard]] QString displayName() const;
|
||||
[[nodiscard]] Type type() const;
|
||||
|
||||
private:
|
||||
QString _shareWith;
|
||||
|
@ -75,12 +75,12 @@ public:
|
|||
|
||||
using ShareeSet = QVector<QSharedPointer<Sharee>>; // FIXME: make it a QSet<Sharee> when Sharee can be compared
|
||||
void fetch(const QString &search, const ShareeSet &blacklist, LookupMode lookupMode);
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
|
||||
|
||||
QSharedPointer<Sharee> getSharee(int at);
|
||||
|
||||
QString currentSearch() const { return _search; }
|
||||
[[nodiscard]] QString currentSearch() const { return _search; }
|
||||
|
||||
signals:
|
||||
void shareesReady();
|
||||
|
|
|
@ -113,7 +113,7 @@ private:
|
|||
void confirmAndDeleteShare();
|
||||
|
||||
/** Retrieve a share's name, accounting for _namesSupported */
|
||||
QString shareName() const;
|
||||
[[nodiscard]] QString shareName() const;
|
||||
|
||||
void customizeStyle();
|
||||
|
||||
|
|
|
@ -70,39 +70,39 @@ public:
|
|||
/**
|
||||
* The account the share is defined on.
|
||||
*/
|
||||
AccountPtr account() const;
|
||||
[[nodiscard]] AccountPtr account() const;
|
||||
|
||||
QString path() const;
|
||||
[[nodiscard]] QString path() const;
|
||||
|
||||
/*
|
||||
* Get the id
|
||||
*/
|
||||
QString getId() const;
|
||||
[[nodiscard]] QString getId() const;
|
||||
|
||||
/*
|
||||
* Get the uid_owner
|
||||
*/
|
||||
QString getUidOwner() const;
|
||||
[[nodiscard]] QString getUidOwner() const;
|
||||
|
||||
/*
|
||||
* Get the owner display name
|
||||
*/
|
||||
QString getOwnerDisplayName() const;
|
||||
[[nodiscard]] QString getOwnerDisplayName() const;
|
||||
|
||||
/*
|
||||
* Get the shareType
|
||||
*/
|
||||
ShareType getShareType() const;
|
||||
[[nodiscard]] ShareType getShareType() const;
|
||||
|
||||
/*
|
||||
* Get the shareWith
|
||||
*/
|
||||
QSharedPointer<Sharee> getShareWith() const;
|
||||
[[nodiscard]] QSharedPointer<Sharee> getShareWith() const;
|
||||
|
||||
/*
|
||||
* Get permissions
|
||||
*/
|
||||
Permissions getPermissions() const;
|
||||
[[nodiscard]] Permissions getPermissions() const;
|
||||
|
||||
/*
|
||||
* Set the permissions of a share
|
||||
|
@ -120,7 +120,7 @@ public:
|
|||
*/
|
||||
void setPassword(const QString &password);
|
||||
|
||||
bool isPasswordSet() const;
|
||||
[[nodiscard]] bool isPasswordSet() const;
|
||||
|
||||
/*
|
||||
* Deletes a share
|
||||
|
@ -189,37 +189,37 @@ public:
|
|||
/*
|
||||
* Get the share link
|
||||
*/
|
||||
QUrl getLink() const;
|
||||
[[nodiscard]] QUrl getLink() const;
|
||||
|
||||
/*
|
||||
* The share's link for direct downloading.
|
||||
*/
|
||||
QUrl getDirectDownloadLink() const;
|
||||
[[nodiscard]] QUrl getDirectDownloadLink() const;
|
||||
|
||||
/*
|
||||
* Get the publicUpload status of this share
|
||||
*/
|
||||
bool getPublicUpload() const;
|
||||
[[nodiscard]] bool getPublicUpload() const;
|
||||
|
||||
/*
|
||||
* Whether directory listings are available (READ permission)
|
||||
*/
|
||||
bool getShowFileListing() const;
|
||||
[[nodiscard]] bool getShowFileListing() const;
|
||||
|
||||
/*
|
||||
* Returns the name of the link share. Can be empty.
|
||||
*/
|
||||
QString getName() const;
|
||||
[[nodiscard]] QString getName() const;
|
||||
|
||||
/*
|
||||
* Returns the note of the link share.
|
||||
*/
|
||||
QString getNote() const;
|
||||
[[nodiscard]] QString getNote() const;
|
||||
|
||||
/*
|
||||
* Returns the label of the link share.
|
||||
*/
|
||||
QString getLabel() const;
|
||||
[[nodiscard]] QString getLabel() const;
|
||||
|
||||
/*
|
||||
* Set the name of the link share.
|
||||
|
@ -236,12 +236,12 @@ public:
|
|||
/*
|
||||
* Returns the token of the link share.
|
||||
*/
|
||||
QString getToken() const;
|
||||
[[nodiscard]] QString getToken() const;
|
||||
|
||||
/*
|
||||
* Get the expiration date
|
||||
*/
|
||||
QDate getExpireDate() const;
|
||||
[[nodiscard]] QDate getExpireDate() const;
|
||||
|
||||
/*
|
||||
* Set the expiration date
|
||||
|
@ -302,13 +302,13 @@ public:
|
|||
|
||||
void setNote(const QString ¬e);
|
||||
|
||||
QString getNote() const;
|
||||
[[nodiscard]] QString getNote() const;
|
||||
|
||||
void slotNoteSet(const QJsonDocument &, const QVariant ¬e);
|
||||
|
||||
void setExpireDate(const QDate &date);
|
||||
|
||||
QDate getExpireDate() const;
|
||||
[[nodiscard]] QDate getExpireDate() const;
|
||||
|
||||
void slotExpireDateSet(const QJsonDocument &reply, const QVariant &value);
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ public:
|
|||
QWidget *parent = nullptr);
|
||||
~ShareUserLine() override;
|
||||
|
||||
QSharedPointer<Share> share() const;
|
||||
[[nodiscard]] QSharedPointer<Share> share() const;
|
||||
|
||||
signals:
|
||||
void visualDeletionDone();
|
||||
|
@ -194,8 +194,8 @@ private:
|
|||
void setDefaultAvatar(int avatarSize);
|
||||
void customizeStyle();
|
||||
|
||||
QPixmap pixmapForShareeType(Sharee::Type type, const QColor &backgroundColor = QColor()) const;
|
||||
QColor backgroundColorForShareeType(Sharee::Type type) const;
|
||||
[[nodiscard]] QPixmap pixmapForShareeType(Sharee::Type type, const QColor &backgroundColor = QColor()) const;
|
||||
[[nodiscard]] QColor backgroundColorForShareeType(Sharee::Type type) const;
|
||||
|
||||
void showNoteOptions(bool show);
|
||||
void toggleNoteOptions(bool enable);
|
||||
|
@ -211,8 +211,8 @@ private:
|
|||
void enableProgessIndicatorAnimation(bool enable);
|
||||
void disableProgessIndicatorAnimation();
|
||||
|
||||
QDate maxExpirationDateForShare(const Share::ShareType type, const QDate &fallbackDate) const;
|
||||
bool enforceExpirationDateForShare(const Share::ShareType type) const;
|
||||
[[nodiscard]] QDate maxExpirationDateForShare(const Share::ShareType type, const QDate &fallbackDate) const;
|
||||
[[nodiscard]] bool enforceExpirationDateForShare(const Share::ShareType type) const;
|
||||
|
||||
Ui::ShareUserLine *_ui;
|
||||
AccountPtr _account;
|
||||
|
|
|
@ -29,7 +29,7 @@ class ShellExtensionsServer : public QObject
|
|||
QSize size;
|
||||
QString folderAlias;
|
||||
|
||||
bool isValid() const { return !path.isEmpty() && !size.isEmpty() && !folderAlias.isEmpty(); }
|
||||
[[nodiscard]] bool isValid() const { return !path.isEmpty() && !size.isEmpty() && !folderAlias.isEmpty(); }
|
||||
};
|
||||
|
||||
Q_OBJECT
|
||||
|
|
|
@ -83,12 +83,12 @@ private:
|
|||
struct FileData
|
||||
{
|
||||
static FileData get(const QString &localFile);
|
||||
SyncFileStatus syncFileStatus() const;
|
||||
SyncJournalFileRecord journalRecord() const;
|
||||
FileData parentFolder() const;
|
||||
[[nodiscard]] SyncFileStatus syncFileStatus() const;
|
||||
[[nodiscard]] SyncJournalFileRecord journalRecord() const;
|
||||
[[nodiscard]] FileData parentFolder() const;
|
||||
|
||||
// Relative path of the file locally, without any vfs suffix
|
||||
QString folderRelativePathNoVfsSuffix() const;
|
||||
[[nodiscard]] QString folderRelativePathNoVfsSuffix() const;
|
||||
|
||||
Folder *folder;
|
||||
// Absolute path of the file locally. (May be a virtual file)
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
hashBits.setBit((hash & 0xFFFF) % NumBits); // NOLINT it's uint all the way and the modulo puts us back in the 0..1023 range
|
||||
hashBits.setBit((hash >> 16) % NumBits); // NOLINT
|
||||
}
|
||||
bool isHashMaybeStored(uint hash) const
|
||||
[[nodiscard]] bool isHashMaybeStored(uint hash) const
|
||||
{
|
||||
return hashBits.testBit((hash & 0xFFFF) % NumBits) // NOLINT
|
||||
&& hashBits.testBit((hash >> 16) % NumBits); // NOLINT
|
||||
|
@ -147,8 +147,8 @@ public:
|
|||
void success(const QJsonObject &response) const;
|
||||
void failure(const QString &error) const;
|
||||
|
||||
const QJsonObject &arguments() const { return _arguments; }
|
||||
QByteArray command() const { return _command; }
|
||||
[[nodiscard]] const QJsonObject &arguments() const { return _arguments; }
|
||||
[[nodiscard]] QByteArray command() const { return _command; }
|
||||
|
||||
Q_SIGNALS:
|
||||
void finished() const;
|
||||
|
|
|
@ -52,13 +52,13 @@ public:
|
|||
~SslErrorDialog() override;
|
||||
bool checkFailingCertsKnown(const QList<QSslError> &errors);
|
||||
bool trustConnection();
|
||||
QList<QSslCertificate> unknownCerts() const { return _unknownCerts; }
|
||||
[[nodiscard]] QList<QSslCertificate> unknownCerts() const { return _unknownCerts; }
|
||||
|
||||
private:
|
||||
QString styleSheet() const;
|
||||
[[nodiscard]] QString styleSheet() const;
|
||||
bool _allTrusted;
|
||||
|
||||
QString certDiv(QSslCertificate) const;
|
||||
[[nodiscard]] QString certDiv(QSslCertificate) const;
|
||||
|
||||
QList<QSslCertificate> _unknownCerts;
|
||||
QString _customConfigHandle;
|
||||
|
|
|
@ -140,16 +140,16 @@ private:
|
|||
|
||||
void setupContextMenu();
|
||||
|
||||
QScreen *currentScreen() const;
|
||||
QRect currentScreenRect() const;
|
||||
QPoint computeWindowReferencePoint() const;
|
||||
QPoint computeNotificationReferencePoint(int spacing = 20, NotificationPosition position = NotificationPosition::Default) const;
|
||||
QPoint calcTrayIconCenter() const;
|
||||
TaskBarPosition taskbarOrientation() const;
|
||||
QRect taskbarGeometry() const;
|
||||
QRect computeWindowRect(int spacing, const QPoint &topLeft, const QPoint &bottomRight) const;
|
||||
QPoint computeWindowPosition(int width, int height) const;
|
||||
QPoint computeNotificationPosition(int width, int height, int spacing = 20, NotificationPosition position = NotificationPosition::Default) const;
|
||||
[[nodiscard]] QScreen *currentScreen() const;
|
||||
[[nodiscard]] QRect currentScreenRect() const;
|
||||
[[nodiscard]] QPoint computeWindowReferencePoint() const;
|
||||
[[nodiscard]] QPoint computeNotificationReferencePoint(int spacing = 20, NotificationPosition position = NotificationPosition::Default) const;
|
||||
[[nodiscard]] QPoint calcTrayIconCenter() const;
|
||||
[[nodiscard]] TaskBarPosition taskbarOrientation() const;
|
||||
[[nodiscard]] QRect taskbarGeometry() const;
|
||||
[[nodiscard]] QRect computeWindowRect(int spacing, const QPoint &topLeft, const QPoint &bottomRight) const;
|
||||
[[nodiscard]] QPoint computeWindowPosition(int width, int height) const;
|
||||
[[nodiscard]] QPoint computeNotificationPosition(int width, int height, int spacing = 20, NotificationPosition position = NotificationPosition::Default) const;
|
||||
|
||||
bool _isOpen = false;
|
||||
bool _syncIsPaused = true;
|
||||
|
|
|
@ -158,7 +158,7 @@ public:
|
|||
*/
|
||||
|
||||
|
||||
Identifier ident() const;
|
||||
[[nodiscard]] Identifier ident() const;
|
||||
};
|
||||
|
||||
bool operator==(const Activity &rhs, const Activity &lhs);
|
||||
|
|
|
@ -83,25 +83,25 @@ public:
|
|||
explicit ActivityListModel(AccountState *accountState,
|
||||
QObject *parent = nullptr);
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
|
||||
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
bool canFetchMore(const QModelIndex &) const override;
|
||||
[[nodiscard]] bool canFetchMore(const QModelIndex &) const override;
|
||||
void fetchMore(const QModelIndex &) override;
|
||||
|
||||
ActivityList activityList() { return _finalList; }
|
||||
ActivityList errorsList() { return _notificationErrorsLists; }
|
||||
|
||||
AccountState *accountState() const;
|
||||
[[nodiscard]] AccountState *accountState() const;
|
||||
|
||||
int currentItem() const;
|
||||
[[nodiscard]] int currentItem() const;
|
||||
|
||||
static constexpr quint32 maxActionButtons()
|
||||
{
|
||||
return MaxActionButtons;
|
||||
}
|
||||
|
||||
QString replyMessageSent(const Activity &activity) const;
|
||||
[[nodiscard]] QString replyMessageSent(const Activity &activity) const;
|
||||
|
||||
public slots:
|
||||
void slotRefreshActivity();
|
||||
|
@ -127,11 +127,11 @@ signals:
|
|||
void sendNotificationRequest(const QString &accountName, const QString &link, const QByteArray &verb, int row);
|
||||
|
||||
protected:
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
bool currentlyFetching() const;
|
||||
[[nodiscard]] bool currentlyFetching() const;
|
||||
|
||||
const ActivityList &finalList() const; // added for unit tests
|
||||
[[nodiscard]] const ActivityList &finalList() const; // added for unit tests
|
||||
|
||||
protected slots:
|
||||
void activitiesReceived(const QJsonDocument &json, int statusCode);
|
||||
|
@ -151,7 +151,7 @@ private:
|
|||
static QVariantList convertLinksToActionButtons(const Activity &activity);
|
||||
static QVariant convertLinkToActionButton(const ActivityLink &activityLink);
|
||||
|
||||
bool canFetchActivities() const;
|
||||
[[nodiscard]] bool canFetchActivities() const;
|
||||
|
||||
void ingestActivities(const QJsonArray &activities);
|
||||
void appendMoreActivitiesAvailableEntry();
|
||||
|
|
|
@ -22,7 +22,7 @@ class AsyncImageResponse : public QQuickImageResponse
|
|||
public:
|
||||
AsyncImageResponse(const QString &id, const QSize &requestedSize);
|
||||
void setImageAndEmitFinished(const QImage &image = {});
|
||||
QQuickTextureFactory *textureFactory() const override;
|
||||
[[nodiscard]] QQuickTextureFactory *textureFactory() const override;
|
||||
|
||||
private:
|
||||
void processNextImage();
|
||||
|
|
|
@ -28,7 +28,7 @@ class SortedActivityListModel : public QSortFilterProxyModel
|
|||
public:
|
||||
explicit SortedActivityListModel(QObject *parent = nullptr);
|
||||
|
||||
ActivityListModel *activityListModel() const;
|
||||
[[nodiscard]] ActivityListModel *activityListModel() const;
|
||||
|
||||
signals:
|
||||
void activityListModelChanged();
|
||||
|
@ -37,7 +37,7 @@ public slots:
|
|||
void setActivityListModel(ActivityListModel *activityListModel);
|
||||
|
||||
protected:
|
||||
bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override;
|
||||
[[nodiscard]] bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override;
|
||||
|
||||
private slots:
|
||||
void sortModel();
|
||||
|
|
|
@ -39,11 +39,11 @@ class SyncStatusSummary : public QObject
|
|||
public:
|
||||
explicit SyncStatusSummary(QObject *parent = nullptr);
|
||||
|
||||
double syncProgress() const;
|
||||
QUrl syncIcon() const;
|
||||
bool syncing() const;
|
||||
QString syncStatusString() const;
|
||||
QString syncStatusDetailString() const;
|
||||
[[nodiscard]] double syncProgress() const;
|
||||
[[nodiscard]] QUrl syncIcon() const;
|
||||
[[nodiscard]] bool syncing() const;
|
||||
[[nodiscard]] QString syncStatusString() const;
|
||||
[[nodiscard]] QString syncStatusDetailString() const;
|
||||
|
||||
signals:
|
||||
void syncProgressChanged();
|
||||
|
@ -66,7 +66,7 @@ private:
|
|||
void setSyncStateForFolder(const Folder *folder);
|
||||
void markFolderAsError(const Folder *folder);
|
||||
void markFolderAsSuccess(const Folder *folder);
|
||||
bool folderErrors() const;
|
||||
[[nodiscard]] bool folderErrors() const;
|
||||
bool folderError(const Folder *folder) const;
|
||||
void clearFolderErrors();
|
||||
void setSyncStateToConnectedState();
|
||||
|
|
|
@ -70,20 +70,20 @@ public:
|
|||
|
||||
explicit UnifiedSearchResultsListModel(AccountState *accountState, QObject *parent = nullptr);
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
|
||||
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
bool isSearchInProgress() const;
|
||||
[[nodiscard]] bool isSearchInProgress() const;
|
||||
|
||||
QString currentFetchMoreInProgressProviderId() const;
|
||||
QString searchTerm() const;
|
||||
QString errorString() const;
|
||||
bool waitingForSearchTermEditEnd() const;
|
||||
[[nodiscard]] QString currentFetchMoreInProgressProviderId() const;
|
||||
[[nodiscard]] QString searchTerm() const;
|
||||
[[nodiscard]] QString errorString() const;
|
||||
[[nodiscard]] bool waitingForSearchTermEditEnd() const;
|
||||
|
||||
Q_INVOKABLE void resultClicked(const QString &providerId, const QUrl &resourceUrl) const;
|
||||
Q_INVOKABLE void fetchMoreTriggerClicked(const QString &providerId);
|
||||
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
private:
|
||||
void startSearch();
|
||||
|
|
|
@ -41,37 +41,37 @@ class User : public QObject
|
|||
public:
|
||||
User(AccountStatePtr &account, const bool &isCurrent = false, QObject *parent = nullptr);
|
||||
|
||||
AccountPtr account() const;
|
||||
AccountStatePtr accountState() const;
|
||||
[[nodiscard]] AccountPtr account() const;
|
||||
[[nodiscard]] AccountStatePtr accountState() const;
|
||||
|
||||
bool isConnected() const;
|
||||
bool isCurrentUser() const;
|
||||
[[nodiscard]] bool isConnected() const;
|
||||
[[nodiscard]] bool isCurrentUser() const;
|
||||
void setCurrentUser(const bool &isCurrent);
|
||||
Folder *getFolder() const;
|
||||
[[nodiscard]] Folder *getFolder() const;
|
||||
ActivityListModel *getActivityModel();
|
||||
UnifiedSearchResultsListModel *getUnifiedSearchResultsListModel() const;
|
||||
[[nodiscard]] UnifiedSearchResultsListModel *getUnifiedSearchResultsListModel() const;
|
||||
void openLocalFolder();
|
||||
QString name() const;
|
||||
QString server(bool shortened = true) const;
|
||||
bool hasLocalFolder() const;
|
||||
bool serverHasTalk() const;
|
||||
bool serverHasUserStatus() const;
|
||||
AccountApp *talkApp() const;
|
||||
bool hasActivities() const;
|
||||
QColor accentColor() const;
|
||||
QColor headerColor() const;
|
||||
QColor headerTextColor() const;
|
||||
AccountAppList appList() const;
|
||||
QImage avatar() const;
|
||||
[[nodiscard]] QString name() const;
|
||||
[[nodiscard]] QString server(bool shortened = true) const;
|
||||
[[nodiscard]] bool hasLocalFolder() const;
|
||||
[[nodiscard]] bool serverHasTalk() const;
|
||||
[[nodiscard]] bool serverHasUserStatus() const;
|
||||
[[nodiscard]] AccountApp *talkApp() const;
|
||||
[[nodiscard]] bool hasActivities() const;
|
||||
[[nodiscard]] QColor accentColor() const;
|
||||
[[nodiscard]] QColor headerColor() const;
|
||||
[[nodiscard]] QColor headerTextColor() const;
|
||||
[[nodiscard]] AccountAppList appList() const;
|
||||
[[nodiscard]] QImage avatar() const;
|
||||
void login() const;
|
||||
void logout() const;
|
||||
void removeAccount() const;
|
||||
QString avatarUrl() const;
|
||||
bool isDesktopNotificationsAllowed() const;
|
||||
UserStatus::OnlineStatus status() const;
|
||||
QString statusMessage() const;
|
||||
QUrl statusIcon() const;
|
||||
QString statusEmoji() const;
|
||||
[[nodiscard]] QString avatarUrl() const;
|
||||
[[nodiscard]] bool isDesktopNotificationsAllowed() const;
|
||||
[[nodiscard]] UserStatus::OnlineStatus status() const;
|
||||
[[nodiscard]] QString statusMessage() const;
|
||||
[[nodiscard]] QUrl statusIcon() const;
|
||||
[[nodiscard]] QString statusEmoji() const;
|
||||
void processCompletedSyncItem(const Folder *folder, const SyncFileItemPtr &item);
|
||||
|
||||
signals:
|
||||
|
@ -117,10 +117,10 @@ private:
|
|||
void slotCheckExpiredActivities();
|
||||
|
||||
void connectPushNotifications() const;
|
||||
bool checkPushNotificationsAreReady() const;
|
||||
[[nodiscard]] bool checkPushNotificationsAreReady() const;
|
||||
|
||||
bool isActivityOfCurrentAccount(const Folder *folder) const;
|
||||
bool isUnsolvableConflict(const SyncFileItemPtr &item) const;
|
||||
[[nodiscard]] bool isUnsolvableConflict(const SyncFileItemPtr &item) const;
|
||||
|
||||
void showDesktopNotification(const QString &title, const QString &message, const long notificationId);
|
||||
|
||||
|
@ -156,18 +156,18 @@ public:
|
|||
void addUser(AccountStatePtr &user, const bool &isCurrent = false);
|
||||
int currentUserIndex();
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
QImage avatarById(const int id);
|
||||
|
||||
User *currentUser() const;
|
||||
[[nodiscard]] User *currentUser() const;
|
||||
|
||||
int findUserIdForAccount(AccountState *account) const;
|
||||
|
||||
Q_INVOKABLE int numUsers();
|
||||
Q_INVOKABLE QString currentUserServer();
|
||||
int currentUserId() const;
|
||||
[[nodiscard]] int currentUserId() const;
|
||||
|
||||
Q_INVOKABLE bool isUserConnected(const int id);
|
||||
|
||||
|
@ -189,7 +189,7 @@ public:
|
|||
IdRole
|
||||
};
|
||||
|
||||
AccountAppList appList() const;
|
||||
[[nodiscard]] AccountAppList appList() const;
|
||||
|
||||
signals:
|
||||
void addAccount();
|
||||
|
@ -206,7 +206,7 @@ public slots:
|
|||
void removeAccount(const int id);
|
||||
|
||||
protected:
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
private:
|
||||
static UserModel *_instance;
|
||||
|
@ -232,9 +232,9 @@ public:
|
|||
static UserAppsModel *instance();
|
||||
~UserAppsModel() override = default;
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
[[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
enum UserAppsRoles {
|
||||
NameRole = Qt::UserRole + 1,
|
||||
|
@ -248,7 +248,7 @@ public slots:
|
|||
void openAppUrl(const QUrl &url);
|
||||
|
||||
protected:
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
private:
|
||||
static UserAppsModel *_instance;
|
||||
|
|
|
@ -110,8 +110,8 @@ public:
|
|||
|
||||
void checkForUpdate() override;
|
||||
|
||||
QString statusString(UpdateStatusStringFormat format = PlainText) const;
|
||||
int downloadState() const;
|
||||
[[nodiscard]] QString statusString(UpdateStatusStringFormat format = PlainText) const;
|
||||
[[nodiscard]] int downloadState() const;
|
||||
void setDownloadState(DownloadState state);
|
||||
|
||||
signals:
|
||||
|
@ -133,9 +133,9 @@ private slots:
|
|||
|
||||
protected:
|
||||
virtual void versionInfoArrived(const UpdateInfo &info) = 0;
|
||||
bool updateSucceeded() const;
|
||||
QNetworkAccessManager *qnam() const { return _accessManager; }
|
||||
UpdateInfo updateInfo() const { return _updateInfo; }
|
||||
[[nodiscard]] bool updateSucceeded() const;
|
||||
[[nodiscard]] QNetworkAccessManager *qnam() const { return _accessManager; }
|
||||
[[nodiscard]] UpdateInfo updateInfo() const { return _updateInfo; }
|
||||
|
||||
private:
|
||||
QUrl _updateUrl;
|
||||
|
|
|
@ -12,13 +12,13 @@ class UpdateInfo
|
|||
{
|
||||
public:
|
||||
void setVersion(const QString &v);
|
||||
QString version() const;
|
||||
[[nodiscard]] QString version() const;
|
||||
void setVersionString(const QString &v);
|
||||
QString versionString() const;
|
||||
[[nodiscard]] QString versionString() const;
|
||||
void setWeb(const QString &v);
|
||||
QString web() const;
|
||||
[[nodiscard]] QString web() const;
|
||||
void setDownloadUrl(const QString &v);
|
||||
QString downloadUrl() const;
|
||||
[[nodiscard]] QString downloadUrl() const;
|
||||
/**
|
||||
Parse XML object from DOM element.
|
||||
*/
|
||||
|
|
|
@ -70,8 +70,8 @@ class UserInfo : public QObject
|
|||
public:
|
||||
explicit UserInfo(OCC::AccountState *accountState, bool allowDisconnectedAccountState, bool fetchAvatarImage, QObject *parent = nullptr);
|
||||
|
||||
qint64 lastQuotaTotalBytes() const { return _lastQuotaTotalBytes; }
|
||||
qint64 lastQuotaUsedBytes() const { return _lastQuotaUsedBytes; }
|
||||
[[nodiscard]] qint64 lastQuotaTotalBytes() const { return _lastQuotaTotalBytes; }
|
||||
[[nodiscard]] qint64 lastQuotaUsedBytes() const { return _lastQuotaUsedBytes; }
|
||||
|
||||
/**
|
||||
* When the quotainfo is active, it requests the quota at regular interval.
|
||||
|
@ -94,7 +94,7 @@ Q_SIGNALS:
|
|||
void fetchedLastInfo(UserInfo *userInfo);
|
||||
|
||||
private:
|
||||
bool canGetInfo() const;
|
||||
[[nodiscard]] bool canGetInfo() const;
|
||||
|
||||
QPointer<AccountState> _accountState;
|
||||
bool _allowDisconnectedAccountState;
|
||||
|
|
|
@ -89,11 +89,11 @@ public:
|
|||
Q_REQUIRED_RESULT QString userStatusEmoji() const;
|
||||
void setUserStatusEmoji(const QString &emoji);
|
||||
|
||||
QVector<UserStatus> predefinedStatuses() const;
|
||||
[[nodiscard]] QVector<UserStatus> predefinedStatuses() const;
|
||||
|
||||
Q_REQUIRED_RESULT QVariantList clearStageTypes() const;
|
||||
Q_REQUIRED_RESULT QString clearAtDisplayString() const;
|
||||
Q_INVOKABLE QString clearAtReadable(const UserStatus &status) const;
|
||||
Q_INVOKABLE [[nodiscard]] QString clearAtReadable(const UserStatus &status) const;
|
||||
|
||||
Q_REQUIRED_RESULT QString errorMessage() const;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class AbstractCredentialsWizardPage : public QWizardPage
|
|||
{
|
||||
public:
|
||||
void cleanupPage() override;
|
||||
virtual AbstractCredentials *getCredentials() const = 0;
|
||||
[[nodiscard]] virtual AbstractCredentials *getCredentials() const = 0;
|
||||
};
|
||||
|
||||
} // namespace OCC
|
||||
|
|
|
@ -38,13 +38,13 @@ class Flow2AuthCredsPage : public AbstractCredentialsWizardPage
|
|||
public:
|
||||
Flow2AuthCredsPage();
|
||||
|
||||
AbstractCredentials *getCredentials() const override;
|
||||
[[nodiscard]] AbstractCredentials *getCredentials() const override;
|
||||
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
int nextId() const override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
void setConnected();
|
||||
bool isComplete() const override;
|
||||
[[nodiscard]] bool isComplete() const override;
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotFlow2AuthResult(Flow2Auth::Result, const QString &errorString, const QString &user, const QString &appPassword);
|
||||
|
|
|
@ -38,14 +38,14 @@ class OwncloudAdvancedSetupPage : public QWizardPage
|
|||
public:
|
||||
OwncloudAdvancedSetupPage(OwncloudWizard *wizard);
|
||||
|
||||
bool isComplete() const override;
|
||||
[[nodiscard]] bool isComplete() const override;
|
||||
void initializePage() override;
|
||||
int nextId() const override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
bool validatePage() override;
|
||||
QString localFolder() const;
|
||||
QStringList selectiveSyncBlacklist() const;
|
||||
bool useVirtualFileSync() const;
|
||||
bool isConfirmBigFolderChecked() const;
|
||||
[[nodiscard]] QString localFolder() const;
|
||||
[[nodiscard]] QStringList selectiveSyncBlacklist() const;
|
||||
[[nodiscard]] bool useVirtualFileSync() const;
|
||||
[[nodiscard]] bool isConfirmBigFolderChecked() const;
|
||||
void setRemoteFolder(const QString &remoteFolder);
|
||||
void setMultipleFoldersExist(bool exist);
|
||||
void directoriesCreated();
|
||||
|
@ -72,9 +72,9 @@ private:
|
|||
bool dataChanged();
|
||||
void startSpinner();
|
||||
void stopSpinner();
|
||||
QUrl serverUrl() const;
|
||||
qint64 availableLocalSpace() const;
|
||||
QString checkLocalSpace(qint64 remoteSize) const;
|
||||
[[nodiscard]] QUrl serverUrl() const;
|
||||
[[nodiscard]] qint64 availableLocalSpace() const;
|
||||
[[nodiscard]] QString checkLocalSpace(qint64 remoteSize) const;
|
||||
void customizeStyle();
|
||||
void setServerAddressLabelUrl(const QUrl &url);
|
||||
void styleSyncLogo();
|
||||
|
|
|
@ -34,12 +34,12 @@ class OwncloudHttpCredsPage : public AbstractCredentialsWizardPage
|
|||
public:
|
||||
OwncloudHttpCredsPage(QWidget *parent);
|
||||
|
||||
AbstractCredentials *getCredentials() const override;
|
||||
[[nodiscard]] AbstractCredentials *getCredentials() const override;
|
||||
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
bool validatePage() override;
|
||||
int nextId() const override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
void setConnected();
|
||||
void setErrorString(const QString &err);
|
||||
|
||||
|
|
|
@ -36,13 +36,13 @@ class OwncloudOAuthCredsPage : public AbstractCredentialsWizardPage
|
|||
public:
|
||||
OwncloudOAuthCredsPage();
|
||||
|
||||
AbstractCredentials *getCredentials() const override;
|
||||
[[nodiscard]] AbstractCredentials *getCredentials() const override;
|
||||
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
int nextId() const override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
void setConnected();
|
||||
bool isComplete() const override;
|
||||
[[nodiscard]] bool isComplete() const override;
|
||||
|
||||
public Q_SLOTS:
|
||||
void asyncAuthResult(OAuth::Result, const QString &user, const QString &token,
|
||||
|
|
|
@ -45,14 +45,14 @@ public:
|
|||
OwncloudSetupPage(QWidget *parent = nullptr);
|
||||
~OwncloudSetupPage() override;
|
||||
|
||||
bool isComplete() const override;
|
||||
[[nodiscard]] bool isComplete() const override;
|
||||
void initializePage() override;
|
||||
int nextId() const override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
void setServerUrl(const QString &);
|
||||
void setAllowPasswordStorage(bool);
|
||||
bool validatePage() override;
|
||||
QString url() const;
|
||||
QString localFolder() const;
|
||||
[[nodiscard]] QString url() const;
|
||||
[[nodiscard]] QString localFolder() const;
|
||||
void setRemoteFolder(const QString &remoteFolder);
|
||||
void setMultipleFoldersExist(bool exist);
|
||||
void setAuthType(DetermineAuthTypeJob::AuthType type);
|
||||
|
|
|
@ -56,20 +56,20 @@ public:
|
|||
OwncloudWizard(QWidget *parent = nullptr);
|
||||
|
||||
void setAccount(AccountPtr account);
|
||||
AccountPtr account() const;
|
||||
[[nodiscard]] AccountPtr account() const;
|
||||
void setOCUrl(const QString &);
|
||||
bool registration();
|
||||
void setRegistration(bool registration);
|
||||
|
||||
void setupCustomMedia(QVariant, QLabel *);
|
||||
QString ocUrl() const;
|
||||
QString localFolder() const;
|
||||
QStringList selectiveSyncBlacklist() const;
|
||||
bool useVirtualFileSync() const;
|
||||
bool isConfirmBigFolderChecked() const;
|
||||
[[nodiscard]] QString ocUrl() const;
|
||||
[[nodiscard]] QString localFolder() const;
|
||||
[[nodiscard]] QStringList selectiveSyncBlacklist() const;
|
||||
[[nodiscard]] bool useVirtualFileSync() const;
|
||||
[[nodiscard]] bool isConfirmBigFolderChecked() const;
|
||||
|
||||
void displayError(const QString &, bool retryHTTPonly);
|
||||
AbstractCredentials *getCredentials() const;
|
||||
[[nodiscard]] AbstractCredentials *getCredentials() const;
|
||||
|
||||
void bringToTop();
|
||||
void centerWindow();
|
||||
|
@ -115,8 +115,8 @@ protected:
|
|||
|
||||
private:
|
||||
void customizeStyle();
|
||||
QSize calculateLargestSizeOfWizardPages(const QList<QSize> &pageSizes) const;
|
||||
QList<QSize> calculateWizardPageSizes() const;
|
||||
[[nodiscard]] QSize calculateLargestSizeOfWizardPages(const QList<QSize> &pageSizes) const;
|
||||
[[nodiscard]] QList<QSize> calculateWizardPageSizes() const;
|
||||
|
||||
AccountPtr _account;
|
||||
WelcomePage *_welcomePage;
|
||||
|
|
|
@ -36,9 +36,9 @@ public:
|
|||
/** @brief sets an optional postfix shown greyed out */
|
||||
void setPostfix(const QString &postfix);
|
||||
/** @brief retrives the postfix */
|
||||
QString postfix() const;
|
||||
[[nodiscard]] QString postfix() const;
|
||||
/** @brief retrieves combined text() and postfix() */
|
||||
QString fullText() const;
|
||||
[[nodiscard]] QString fullText() const;
|
||||
|
||||
/** @brief sets text() from full text, discarding prefix() */
|
||||
void setFullText(const QString &text);
|
||||
|
|
|
@ -37,15 +37,15 @@ public:
|
|||
|
||||
void addSlide(const QPixmap &pixmap, const QString &label);
|
||||
|
||||
bool isActive() const;
|
||||
[[nodiscard]] bool isActive() const;
|
||||
|
||||
int interval() const;
|
||||
[[nodiscard]] int interval() const;
|
||||
void setInterval(int interval);
|
||||
|
||||
int currentSlide() const;
|
||||
[[nodiscard]] int currentSlide() const;
|
||||
void setCurrentSlide(int index);
|
||||
|
||||
QSize sizeHint() const override;
|
||||
[[nodiscard]] QSize sizeHint() const override;
|
||||
|
||||
public slots:
|
||||
void startShow(int interval = 0);
|
||||
|
|
|
@ -18,10 +18,10 @@ public:
|
|||
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
int nextId() const override;
|
||||
bool isComplete() const override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
[[nodiscard]] bool isComplete() const override;
|
||||
|
||||
AbstractCredentials* getCredentials() const override;
|
||||
[[nodiscard]] AbstractCredentials* getCredentials() const override;
|
||||
void setConnected();
|
||||
|
||||
signals:
|
||||
|
|
|
@ -33,7 +33,7 @@ class WelcomePage : public QWizardPage
|
|||
public:
|
||||
explicit WelcomePage(OwncloudWizard *ocWizard);
|
||||
~WelcomePage() override;
|
||||
int nextId() const override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
void initializePage() override;
|
||||
void setLoginButtonDefault();
|
||||
|
||||
|
|
|
@ -45,16 +45,16 @@ public:
|
|||
|
||||
virtual void start();
|
||||
|
||||
AccountPtr account() const { return _account; }
|
||||
[[nodiscard]] AccountPtr account() const { return _account; }
|
||||
|
||||
void setPath(const QString &path);
|
||||
QString path() const { return _path; }
|
||||
[[nodiscard]] QString path() const { return _path; }
|
||||
|
||||
void setReply(QNetworkReply *reply);
|
||||
QNetworkReply *reply() const { return _reply; }
|
||||
[[nodiscard]] QNetworkReply *reply() const { return _reply; }
|
||||
|
||||
void setIgnoreCredentialFailure(bool ignore);
|
||||
bool ignoreCredentialFailure() const { return _ignoreCredentialFailure; }
|
||||
[[nodiscard]] bool ignoreCredentialFailure() const { return _ignoreCredentialFailure; }
|
||||
|
||||
/** Whether to handle redirects transparently.
|
||||
*
|
||||
|
@ -67,17 +67,17 @@ public:
|
|||
* requests where custom handling is necessary.
|
||||
*/
|
||||
void setFollowRedirects(bool follow);
|
||||
bool followRedirects() const { return _followRedirects; }
|
||||
[[nodiscard]] bool followRedirects() const { return _followRedirects; }
|
||||
|
||||
QByteArray responseTimestamp();
|
||||
/* Content of the X-Request-ID header. (Only set after the request is sent) */
|
||||
QByteArray requestId();
|
||||
|
||||
qint64 timeoutMsec() const { return _timer.interval(); }
|
||||
bool timedOut() const { return _timedout; }
|
||||
[[nodiscard]] qint64 timeoutMsec() const { return _timer.interval(); }
|
||||
[[nodiscard]] bool timedOut() const { return _timedout; }
|
||||
|
||||
/** Returns an error message, if any. */
|
||||
virtual QString errorString() const;
|
||||
[[nodiscard]] virtual QString errorString() const;
|
||||
|
||||
/** Like errorString, but also checking the reply body for information.
|
||||
*
|
||||
|
@ -159,12 +159,12 @@ protected:
|
|||
virtual void newReplyHook(QNetworkReply *) {}
|
||||
|
||||
/// Creates a url for the account from a relative path
|
||||
QUrl makeAccountUrl(const QString &relativePath) const;
|
||||
[[nodiscard]] QUrl makeAccountUrl(const QString &relativePath) const;
|
||||
|
||||
/// Like makeAccountUrl() but uses the account's dav base path
|
||||
QUrl makeDavUrl(const QString &relativePath) const;
|
||||
[[nodiscard]] QUrl makeDavUrl(const QString &relativePath) const;
|
||||
|
||||
int maxRedirects() const { return 10; }
|
||||
[[nodiscard]] int maxRedirects() const { return 10; }
|
||||
|
||||
/** Called at the end of QNetworkReply::finished processing.
|
||||
*
|
||||
|
|
|
@ -34,8 +34,8 @@ public:
|
|||
AbstractPropagateRemoteDeleteEncrypted(OwncloudPropagator *propagator, SyncFileItemPtr item, QObject *parent);
|
||||
~AbstractPropagateRemoteDeleteEncrypted() override = default;
|
||||
|
||||
QNetworkReply::NetworkError networkError() const;
|
||||
QString errorString() const;
|
||||
[[nodiscard]] QNetworkReply::NetworkError networkError() const;
|
||||
[[nodiscard]] QString errorString() const;
|
||||
|
||||
virtual void start() = 0;
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
|
||||
AccountPtr sharedFromThis();
|
||||
|
||||
AccountPtr sharedFromThis() const;
|
||||
[[nodiscard]] AccountPtr sharedFromThis() const;
|
||||
|
||||
/**
|
||||
* The user that can be used in dav url.
|
||||
|
@ -99,30 +99,30 @@ public:
|
|||
* This can very well be different frome the login user that's
|
||||
* stored in credentials()->user().
|
||||
*/
|
||||
QString davUser() const;
|
||||
[[nodiscard]] QString davUser() const;
|
||||
void setDavUser(const QString &newDavUser);
|
||||
|
||||
QString davDisplayName() const;
|
||||
[[nodiscard]] QString davDisplayName() const;
|
||||
void setDavDisplayName(const QString &newDisplayName);
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
QImage avatar() const;
|
||||
[[nodiscard]] QImage avatar() const;
|
||||
void setAvatar(const QImage &img);
|
||||
#endif
|
||||
|
||||
/// The name of the account as shown in the toolbar
|
||||
QString displayName() const;
|
||||
[[nodiscard]] QString displayName() const;
|
||||
|
||||
QColor accentColor() const;
|
||||
QColor headerColor() const;
|
||||
QColor headerTextColor() const;
|
||||
[[nodiscard]] QColor accentColor() const;
|
||||
[[nodiscard]] QColor headerColor() const;
|
||||
[[nodiscard]] QColor headerTextColor() const;
|
||||
|
||||
/// The internal id of the account.
|
||||
QString id() const;
|
||||
[[nodiscard]] QString id() const;
|
||||
|
||||
/** Server url of the account */
|
||||
void setUrl(const QUrl &url);
|
||||
QUrl url() const { return _url; }
|
||||
[[nodiscard]] QUrl url() const { return _url; }
|
||||
|
||||
/// Adjusts _userVisibleUrl once the host to use is discovered.
|
||||
void setUserVisibleHost(const QString &host);
|
||||
|
@ -132,20 +132,20 @@ public:
|
|||
* a trailing slash.
|
||||
* @returns the (themeable) dav path for the account.
|
||||
*/
|
||||
QString davPath() const;
|
||||
[[nodiscard]] QString davPath() const;
|
||||
|
||||
/** Returns webdav entry URL, based on url() */
|
||||
QUrl davUrl() const;
|
||||
[[nodiscard]] QUrl davUrl() const;
|
||||
|
||||
/** Returns the legacy permalink url for a file.
|
||||
*
|
||||
* This uses the old way of manually building the url. New code should
|
||||
* use the "privatelink" property accessible via PROPFIND.
|
||||
*/
|
||||
QUrl deprecatedPrivateLinkUrl(const QByteArray &numericFileId) const;
|
||||
[[nodiscard]] QUrl deprecatedPrivateLinkUrl(const QByteArray &numericFileId) const;
|
||||
|
||||
/** Holds the accounts credentials */
|
||||
AbstractCredentials *credentials() const;
|
||||
[[nodiscard]] AbstractCredentials *credentials() const;
|
||||
void setCredentials(AbstractCredentials *cred);
|
||||
|
||||
/** Create a network request on the account's QNAM.
|
||||
|
@ -176,7 +176,7 @@ public:
|
|||
|
||||
/** The ssl configuration during the first connection */
|
||||
QSslConfiguration getOrCreateSslConfig();
|
||||
QSslConfiguration sslConfiguration() const { return _sslConfiguration; }
|
||||
[[nodiscard]] QSslConfiguration sslConfiguration() const { return _sslConfiguration; }
|
||||
void setSslConfiguration(const QSslConfiguration &config);
|
||||
// Because of bugs in Qt, we use this to store info needed for the SSL Button
|
||||
QSslCipher _sessionCipher;
|
||||
|
@ -185,7 +185,7 @@ public:
|
|||
|
||||
|
||||
/** The certificates of the account */
|
||||
QList<QSslCertificate> approvedCerts() const { return _approvedCerts; }
|
||||
[[nodiscard]] QList<QSslCertificate> approvedCerts() const { return _approvedCerts; }
|
||||
void setApprovedCerts(const QList<QSslCertificate> certs);
|
||||
void addApprovedCerts(const QList<QSslCertificate> certs);
|
||||
|
||||
|
@ -198,14 +198,14 @@ public:
|
|||
void setSslErrorHandler(AbstractSslErrorHandler *handler);
|
||||
|
||||
// To be called by credentials only, for storing username and the like
|
||||
QVariant credentialSetting(const QString &key) const;
|
||||
[[nodiscard]] QVariant credentialSetting(const QString &key) const;
|
||||
void setCredentialSetting(const QString &key, const QVariant &value);
|
||||
|
||||
/** Assign a client certificate */
|
||||
void setCertificate(const QByteArray certficate = QByteArray(), const QString privateKey = QString());
|
||||
|
||||
/** Access the server capabilities */
|
||||
const Capabilities &capabilities() const;
|
||||
[[nodiscard]] const Capabilities &capabilities() const;
|
||||
void setCapabilities(const QVariantMap &caps);
|
||||
|
||||
/** Access the server version
|
||||
|
@ -213,7 +213,7 @@ public:
|
|||
* For servers >= 10.0.0, this can be the empty string until capabilities
|
||||
* have been received.
|
||||
*/
|
||||
QString serverVersion() const;
|
||||
[[nodiscard]] QString serverVersion() const;
|
||||
|
||||
/** Server version for easy comparison.
|
||||
*
|
||||
|
@ -221,7 +221,7 @@ public:
|
|||
*
|
||||
* Will be 0 if the version is not available yet.
|
||||
*/
|
||||
int serverVersionInt() const;
|
||||
[[nodiscard]] int serverVersionInt() const;
|
||||
|
||||
static constexpr int makeServerVersion(const int majorVersion, const int minorVersion, const int patchVersion) {
|
||||
return (majorVersion << 16) + (minorVersion << 8) + patchVersion;
|
||||
|
@ -239,13 +239,13 @@ public:
|
|||
*
|
||||
* This function returns true if the server is beyond the weak limit.
|
||||
*/
|
||||
bool serverVersionUnsupported() const;
|
||||
[[nodiscard]] bool serverVersionUnsupported() const;
|
||||
|
||||
bool isUsernamePrefillSupported() const;
|
||||
[[nodiscard]] bool isUsernamePrefillSupported() const;
|
||||
|
||||
bool isChecksumRecalculateRequestSupported() const;
|
||||
[[nodiscard]] bool isChecksumRecalculateRequestSupported() const;
|
||||
|
||||
int checksumRecalculateServerVersionMinSupportedMajor() const;
|
||||
[[nodiscard]] int checksumRecalculateServerVersionMinSupportedMajor() const;
|
||||
|
||||
/** True when the server connection is using HTTP2 */
|
||||
bool isHttp2Supported() { return _http2Supported; }
|
||||
|
@ -277,10 +277,10 @@ public:
|
|||
|
||||
void setupUserStatusConnector();
|
||||
void trySetupPushNotifications();
|
||||
PushNotifications *pushNotifications() const;
|
||||
[[nodiscard]] PushNotifications *pushNotifications() const;
|
||||
void setPushNotificationsReconnectInterval(int interval);
|
||||
|
||||
std::shared_ptr<UserStatusConnector> userStatusConnector() const;
|
||||
[[nodiscard]] std::shared_ptr<UserStatusConnector> userStatusConnector() const;
|
||||
|
||||
void setLockFileState(const QString &serverRelativePath,
|
||||
SyncJournalDb * const journal,
|
||||
|
|
|
@ -111,7 +111,7 @@ private:
|
|||
const QString &errorString);
|
||||
|
||||
/** Bases headers that need to be sent on the PUT, or in the MOVE for chunking-ng */
|
||||
QMap<QByteArray, QByteArray> headers(SyncFileItemPtr item) const;
|
||||
[[nodiscard]] QMap<QByteArray, QByteArray> headers(SyncFileItemPtr item) const;
|
||||
|
||||
void abortWithError(SyncFileItemPtr item,
|
||||
SyncFileItem::Status status,
|
||||
|
|
|
@ -46,54 +46,54 @@ class OWNCLOUDSYNC_EXPORT Capabilities
|
|||
public:
|
||||
Capabilities(const QVariantMap &capabilities);
|
||||
|
||||
bool shareAPI() const;
|
||||
bool shareEmailPasswordEnabled() const;
|
||||
bool shareEmailPasswordEnforced() const;
|
||||
bool sharePublicLink() const;
|
||||
bool sharePublicLinkAllowUpload() const;
|
||||
bool sharePublicLinkSupportsUploadOnly() const;
|
||||
bool sharePublicLinkAskOptionalPassword() const;
|
||||
bool sharePublicLinkEnforcePassword() const;
|
||||
bool sharePublicLinkEnforceExpireDate() const;
|
||||
int sharePublicLinkExpireDateDays() const;
|
||||
bool shareInternalEnforceExpireDate() const;
|
||||
int shareInternalExpireDateDays() const;
|
||||
bool shareRemoteEnforceExpireDate() const;
|
||||
int shareRemoteExpireDateDays() const;
|
||||
bool sharePublicLinkMultiple() const;
|
||||
bool shareResharing() const;
|
||||
int shareDefaultPermissions() const;
|
||||
bool chunkingNg() const;
|
||||
bool bulkUpload() const;
|
||||
bool filesLockAvailable() const;
|
||||
bool userStatus() const;
|
||||
bool userStatusSupportsEmoji() const;
|
||||
QColor serverColor() const;
|
||||
QColor serverTextColor() const;
|
||||
[[nodiscard]] bool shareAPI() const;
|
||||
[[nodiscard]] bool shareEmailPasswordEnabled() const;
|
||||
[[nodiscard]] bool shareEmailPasswordEnforced() const;
|
||||
[[nodiscard]] bool sharePublicLink() const;
|
||||
[[nodiscard]] bool sharePublicLinkAllowUpload() const;
|
||||
[[nodiscard]] bool sharePublicLinkSupportsUploadOnly() const;
|
||||
[[nodiscard]] bool sharePublicLinkAskOptionalPassword() const;
|
||||
[[nodiscard]] bool sharePublicLinkEnforcePassword() const;
|
||||
[[nodiscard]] bool sharePublicLinkEnforceExpireDate() const;
|
||||
[[nodiscard]] int sharePublicLinkExpireDateDays() const;
|
||||
[[nodiscard]] bool shareInternalEnforceExpireDate() const;
|
||||
[[nodiscard]] int shareInternalExpireDateDays() const;
|
||||
[[nodiscard]] bool shareRemoteEnforceExpireDate() const;
|
||||
[[nodiscard]] int shareRemoteExpireDateDays() const;
|
||||
[[nodiscard]] bool sharePublicLinkMultiple() const;
|
||||
[[nodiscard]] bool shareResharing() const;
|
||||
[[nodiscard]] int shareDefaultPermissions() const;
|
||||
[[nodiscard]] bool chunkingNg() const;
|
||||
[[nodiscard]] bool bulkUpload() const;
|
||||
[[nodiscard]] bool filesLockAvailable() const;
|
||||
[[nodiscard]] bool userStatus() const;
|
||||
[[nodiscard]] bool userStatusSupportsEmoji() const;
|
||||
[[nodiscard]] QColor serverColor() const;
|
||||
[[nodiscard]] QColor serverTextColor() const;
|
||||
|
||||
/// Returns which kind of push notfications are available
|
||||
PushNotificationTypes availablePushNotifications() const;
|
||||
[[nodiscard]] PushNotificationTypes availablePushNotifications() const;
|
||||
|
||||
/// Websocket url for files push notifications if available
|
||||
QUrl pushNotificationsWebSocketUrl() const;
|
||||
[[nodiscard]] QUrl pushNotificationsWebSocketUrl() const;
|
||||
|
||||
/// disable parallel upload in chunking
|
||||
bool chunkingParallelUploadDisabled() const;
|
||||
[[nodiscard]] bool chunkingParallelUploadDisabled() const;
|
||||
|
||||
/// Whether the "privatelink" DAV property is available
|
||||
bool privateLinkPropertyAvailable() const;
|
||||
[[nodiscard]] bool privateLinkPropertyAvailable() const;
|
||||
|
||||
/// returns true if the capabilities report notifications
|
||||
bool notificationsAvailable() const;
|
||||
[[nodiscard]] bool notificationsAvailable() const;
|
||||
|
||||
/// returns true if the server supports client side encryption
|
||||
bool clientSideEncryptionAvailable() const;
|
||||
[[nodiscard]] bool clientSideEncryptionAvailable() const;
|
||||
|
||||
/// returns true if the capabilities are loaded already.
|
||||
bool isValid() const;
|
||||
[[nodiscard]] bool isValid() const;
|
||||
|
||||
/// return true if the activity app is enabled
|
||||
bool hasActivities() const;
|
||||
[[nodiscard]] bool hasActivities() const;
|
||||
|
||||
/**
|
||||
* Returns the checksum types the server understands.
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
* Default: []
|
||||
* Possible entries: "Adler32", "MD5", "SHA1"
|
||||
*/
|
||||
QList<QByteArray> supportedChecksumTypes() const;
|
||||
[[nodiscard]] QList<QByteArray> supportedChecksumTypes() const;
|
||||
|
||||
/**
|
||||
* The checksum algorithm that the server recommends for file uploads.
|
||||
|
@ -116,14 +116,14 @@ public:
|
|||
* Default: empty, meaning "no preference"
|
||||
* Possible values: empty or any of the supportedTypes
|
||||
*/
|
||||
QByteArray preferredUploadChecksumType() const;
|
||||
[[nodiscard]] QByteArray preferredUploadChecksumType() const;
|
||||
|
||||
/**
|
||||
* Helper that returns the preferredUploadChecksumType() if set, or one
|
||||
* of the supportedChecksumTypes() if it isn't. May return an empty
|
||||
* QByteArray if no checksum types are supported.
|
||||
*/
|
||||
QByteArray uploadChecksumType() const;
|
||||
[[nodiscard]] QByteArray uploadChecksumType() const;
|
||||
|
||||
/**
|
||||
* List of HTTP error codes should be guaranteed to eventually reset
|
||||
|
@ -142,7 +142,7 @@ public:
|
|||
* Default: []
|
||||
* Example: [503, 500]
|
||||
*/
|
||||
QList<int> httpErrorCodesThatResetFailingChunkedUploads() const;
|
||||
[[nodiscard]] QList<int> httpErrorCodesThatResetFailingChunkedUploads() const;
|
||||
|
||||
/**
|
||||
* Regex that, if contained in a filename, will result in it not being uploaded.
|
||||
|
@ -153,17 +153,17 @@ public:
|
|||
*
|
||||
* Note that it just needs to be contained. The regex [ab] is contained in "car".
|
||||
*/
|
||||
QString invalidFilenameRegex() const;
|
||||
[[nodiscard]] QString invalidFilenameRegex() const;
|
||||
|
||||
/**
|
||||
* return the list of filename that should not be uploaded
|
||||
*/
|
||||
QStringList blacklistedFiles() const;
|
||||
[[nodiscard]] QStringList blacklistedFiles() const;
|
||||
|
||||
/**
|
||||
* Whether conflict files should remain local (default) or should be uploaded.
|
||||
*/
|
||||
bool uploadConflictFiles() const;
|
||||
[[nodiscard]] bool uploadConflictFiles() const;
|
||||
|
||||
// Direct Editing
|
||||
void addDirectEditor(DirectEditor* directEditor);
|
||||
|
@ -171,7 +171,7 @@ public:
|
|||
DirectEditor* getDirectEditorForOptionalMimetype(const QMimeType &mimeType);
|
||||
|
||||
private:
|
||||
QMap<QString, QVariant> serverThemingMap() const;
|
||||
[[nodiscard]] QMap<QString, QVariant> serverThemingMap() const;
|
||||
|
||||
QVariantMap _capabilities;
|
||||
|
||||
|
@ -192,11 +192,11 @@ public:
|
|||
bool hasMimetype(const QMimeType &mimeType);
|
||||
bool hasOptionalMimetype(const QMimeType &mimeType);
|
||||
|
||||
QString id() const;
|
||||
QString name() const;
|
||||
[[nodiscard]] QString id() const;
|
||||
[[nodiscard]] QString name() const;
|
||||
|
||||
QList<QByteArray> mimeTypes() const;
|
||||
QList<QByteArray> optionalMimeTypes() const;
|
||||
[[nodiscard]] QList<QByteArray> mimeTypes() const;
|
||||
[[nodiscard]] QList<QByteArray> optionalMimeTypes() const;
|
||||
|
||||
private:
|
||||
QString _id;
|
||||
|
|
|
@ -99,8 +99,8 @@ public:
|
|||
|
||||
QByteArray chunkDecryption(const char *input, quint64 chunkSize);
|
||||
|
||||
bool isInitialized() const;
|
||||
bool isFinished() const;
|
||||
[[nodiscard]] bool isInitialized() const;
|
||||
[[nodiscard]] bool isFinished() const;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(StreamingDecryptor)
|
||||
|
@ -127,7 +127,7 @@ private:
|
|||
public:
|
||||
void forgetSensitiveData(const AccountPtr &account);
|
||||
|
||||
bool newMnemonicGenerated() const;
|
||||
[[nodiscard]] bool newMnemonicGenerated() const;
|
||||
|
||||
public slots:
|
||||
void slotRequestMnemonic();
|
||||
|
@ -150,8 +150,8 @@ private:
|
|||
|
||||
void fetchFromKeyChain(const AccountPtr &account);
|
||||
|
||||
bool checkPublicKeyValidity(const AccountPtr &account) const;
|
||||
bool checkServerPublicKeyValidity(const QByteArray &serverPublicKeyString) const;
|
||||
[[nodiscard]] bool checkPublicKeyValidity(const AccountPtr &account) const;
|
||||
[[nodiscard]] bool checkServerPublicKeyValidity(const QByteArray &serverPublicKeyString) const;
|
||||
void writePrivateKey(const AccountPtr &account);
|
||||
void writeCertificate(const AccountPtr &account);
|
||||
void writeMnemonic(const AccountPtr &account);
|
||||
|
@ -186,7 +186,7 @@ public:
|
|||
void addEncryptedFile(const EncryptedFile& f);
|
||||
void removeEncryptedFile(const EncryptedFile& f);
|
||||
void removeAllEncryptedFiles();
|
||||
QVector<EncryptedFile> files() const;
|
||||
[[nodiscard]] QVector<EncryptedFile> files() const;
|
||||
|
||||
|
||||
private:
|
||||
|
@ -196,11 +196,11 @@ private:
|
|||
void setupEmptyMetadata();
|
||||
void setupExistingMetadata(const QByteArray& metadata);
|
||||
|
||||
QByteArray encryptMetadataKey(const QByteArray& metadataKey) const;
|
||||
QByteArray decryptMetadataKey(const QByteArray& encryptedKey) const;
|
||||
[[nodiscard]] QByteArray encryptMetadataKey(const QByteArray& metadataKey) const;
|
||||
[[nodiscard]] QByteArray decryptMetadataKey(const QByteArray& encryptedKey) const;
|
||||
|
||||
QByteArray encryptJsonObject(const QByteArray& obj, const QByteArray pass) const;
|
||||
QByteArray decryptJsonObject(const QByteArray& encryptedJsonBlob, const QByteArray& pass) const;
|
||||
[[nodiscard]] QByteArray encryptJsonObject(const QByteArray& obj, const QByteArray pass) const;
|
||||
[[nodiscard]] QByteArray decryptJsonObject(const QByteArray& encryptedJsonBlob, const QByteArray& pass) const;
|
||||
|
||||
QVector<EncryptedFile> _files;
|
||||
QMap<int, QByteArray> _metadataKeys;
|
||||
|
|
|
@ -43,9 +43,9 @@ public:
|
|||
enum Scope { UserScope,
|
||||
SystemScope };
|
||||
|
||||
QString configPath() const;
|
||||
QString configFile() const;
|
||||
QString excludeFile(Scope scope) const;
|
||||
[[nodiscard]] QString configPath() const;
|
||||
[[nodiscard]] QString configFile() const;
|
||||
[[nodiscard]] QString excludeFile(Scope scope) const;
|
||||
static QString excludeFileFromSystem(); // doesn't access config dir
|
||||
|
||||
/**
|
||||
|
@ -53,11 +53,11 @@ public:
|
|||
*
|
||||
* Returns the path of the new backup.
|
||||
*/
|
||||
QString backup() const;
|
||||
[[nodiscard]] QString backup() const;
|
||||
|
||||
bool exists();
|
||||
|
||||
QString defaultConnection() const;
|
||||
[[nodiscard]] QString defaultConnection() const;
|
||||
|
||||
// the certs do not depend on a connection.
|
||||
QByteArray caCerts();
|
||||
|
@ -66,49 +66,49 @@ public:
|
|||
bool passwordStorageAllowed(const QString &connection = QString());
|
||||
|
||||
/* Server poll interval in milliseconds */
|
||||
std::chrono::milliseconds remotePollInterval(const QString &connection = QString()) const;
|
||||
[[nodiscard]] std::chrono::milliseconds remotePollInterval(const QString &connection = QString()) const;
|
||||
/* Set poll interval. Value in milliseconds has to be larger than 5000 */
|
||||
void setRemotePollInterval(std::chrono::milliseconds interval, const QString &connection = QString());
|
||||
|
||||
/* Interval to check for new notifications */
|
||||
std::chrono::milliseconds notificationRefreshInterval(const QString &connection = QString()) const;
|
||||
[[nodiscard]] std::chrono::milliseconds notificationRefreshInterval(const QString &connection = QString()) const;
|
||||
|
||||
/* Force sync interval, in milliseconds */
|
||||
std::chrono::milliseconds forceSyncInterval(const QString &connection = QString()) const;
|
||||
[[nodiscard]] std::chrono::milliseconds forceSyncInterval(const QString &connection = QString()) const;
|
||||
|
||||
/**
|
||||
* Interval in milliseconds within which full local discovery is required
|
||||
*
|
||||
* Use -1 to disable regular full local discoveries.
|
||||
*/
|
||||
std::chrono::milliseconds fullLocalDiscoveryInterval() const;
|
||||
[[nodiscard]] std::chrono::milliseconds fullLocalDiscoveryInterval() const;
|
||||
|
||||
bool monoIcons() const;
|
||||
[[nodiscard]] bool monoIcons() const;
|
||||
void setMonoIcons(bool);
|
||||
|
||||
bool promptDeleteFiles() const;
|
||||
[[nodiscard]] bool promptDeleteFiles() const;
|
||||
void setPromptDeleteFiles(bool promptDeleteFiles);
|
||||
|
||||
bool crashReporter() const;
|
||||
[[nodiscard]] bool crashReporter() const;
|
||||
void setCrashReporter(bool enabled);
|
||||
|
||||
bool automaticLogDir() const;
|
||||
[[nodiscard]] bool automaticLogDir() const;
|
||||
void setAutomaticLogDir(bool enabled);
|
||||
|
||||
QString logDir() const;
|
||||
[[nodiscard]] QString logDir() const;
|
||||
void setLogDir(const QString &dir);
|
||||
|
||||
bool logDebug() const;
|
||||
[[nodiscard]] bool logDebug() const;
|
||||
void setLogDebug(bool enabled);
|
||||
|
||||
int logExpire() const;
|
||||
[[nodiscard]] int logExpire() const;
|
||||
void setLogExpire(int hours);
|
||||
|
||||
bool logFlush() const;
|
||||
[[nodiscard]] bool logFlush() const;
|
||||
void setLogFlush(bool enabled);
|
||||
|
||||
// Whether experimental UI options should be shown
|
||||
bool showExperimentalOptions() const;
|
||||
[[nodiscard]] bool showExperimentalOptions() const;
|
||||
|
||||
// proxy settings
|
||||
void setProxyType(int proxyType,
|
||||
|
@ -117,86 +117,86 @@ public:
|
|||
const QString &user = QString(),
|
||||
const QString &pass = QString());
|
||||
|
||||
int proxyType() const;
|
||||
QString proxyHostName() const;
|
||||
int proxyPort() const;
|
||||
bool proxyNeedsAuth() const;
|
||||
QString proxyUser() const;
|
||||
QString proxyPassword() const;
|
||||
[[nodiscard]] int proxyType() const;
|
||||
[[nodiscard]] QString proxyHostName() const;
|
||||
[[nodiscard]] int proxyPort() const;
|
||||
[[nodiscard]] bool proxyNeedsAuth() const;
|
||||
[[nodiscard]] QString proxyUser() const;
|
||||
[[nodiscard]] QString proxyPassword() const;
|
||||
|
||||
/** 0: no limit, 1: manual, >0: automatic */
|
||||
int useUploadLimit() const;
|
||||
int useDownloadLimit() const;
|
||||
[[nodiscard]] int useUploadLimit() const;
|
||||
[[nodiscard]] int useDownloadLimit() const;
|
||||
void setUseUploadLimit(int);
|
||||
void setUseDownloadLimit(int);
|
||||
/** in kbyte/s */
|
||||
int uploadLimit() const;
|
||||
int downloadLimit() const;
|
||||
[[nodiscard]] int uploadLimit() const;
|
||||
[[nodiscard]] int downloadLimit() const;
|
||||
void setUploadLimit(int kbytes);
|
||||
void setDownloadLimit(int kbytes);
|
||||
/** [checked, size in MB] **/
|
||||
QPair<bool, qint64> newBigFolderSizeLimit() const;
|
||||
[[nodiscard]] QPair<bool, qint64> newBigFolderSizeLimit() const;
|
||||
void setNewBigFolderSizeLimit(bool isChecked, qint64 mbytes);
|
||||
bool useNewBigFolderSizeLimit() const;
|
||||
bool confirmExternalStorage() const;
|
||||
[[nodiscard]] bool useNewBigFolderSizeLimit() const;
|
||||
[[nodiscard]] bool confirmExternalStorage() const;
|
||||
void setConfirmExternalStorage(bool);
|
||||
|
||||
/** If we should move the files deleted on the server in the trash */
|
||||
bool moveToTrash() const;
|
||||
[[nodiscard]] bool moveToTrash() const;
|
||||
void setMoveToTrash(bool);
|
||||
|
||||
bool showMainDialogAsNormalWindow() const;
|
||||
[[nodiscard]] bool showMainDialogAsNormalWindow() const;
|
||||
|
||||
static bool setConfDir(const QString &value);
|
||||
|
||||
bool optionalServerNotifications() const;
|
||||
[[nodiscard]] bool optionalServerNotifications() const;
|
||||
void setOptionalServerNotifications(bool show);
|
||||
|
||||
bool showCallNotifications() const;
|
||||
[[nodiscard]] bool showCallNotifications() const;
|
||||
void setShowCallNotifications(bool show);
|
||||
|
||||
bool showInExplorerNavigationPane() const;
|
||||
[[nodiscard]] bool showInExplorerNavigationPane() const;
|
||||
void setShowInExplorerNavigationPane(bool show);
|
||||
|
||||
int timeout() const;
|
||||
qint64 chunkSize() const;
|
||||
qint64 maxChunkSize() const;
|
||||
qint64 minChunkSize() const;
|
||||
std::chrono::milliseconds targetChunkUploadDuration() const;
|
||||
[[nodiscard]] int timeout() const;
|
||||
[[nodiscard]] qint64 chunkSize() const;
|
||||
[[nodiscard]] qint64 maxChunkSize() const;
|
||||
[[nodiscard]] qint64 minChunkSize() const;
|
||||
[[nodiscard]] std::chrono::milliseconds targetChunkUploadDuration() const;
|
||||
|
||||
void saveGeometry(QWidget *w);
|
||||
void restoreGeometry(QWidget *w);
|
||||
|
||||
// how often the check about new versions runs
|
||||
std::chrono::milliseconds updateCheckInterval(const QString &connection = QString()) const;
|
||||
[[nodiscard]] std::chrono::milliseconds updateCheckInterval(const QString &connection = QString()) const;
|
||||
|
||||
// skipUpdateCheck completely disables the updater and hides its UI
|
||||
bool skipUpdateCheck(const QString &connection = QString()) const;
|
||||
[[nodiscard]] bool skipUpdateCheck(const QString &connection = QString()) const;
|
||||
void setSkipUpdateCheck(bool, const QString &);
|
||||
|
||||
// autoUpdateCheck allows the user to make the choice in the UI
|
||||
bool autoUpdateCheck(const QString &connection = QString()) const;
|
||||
[[nodiscard]] bool autoUpdateCheck(const QString &connection = QString()) const;
|
||||
void setAutoUpdateCheck(bool, const QString &);
|
||||
|
||||
/** Query-parameter 'updatesegment' for the update check, value between 0 and 99.
|
||||
Used to throttle down desktop release rollout in order to keep the update servers alive at peak times.
|
||||
See: https://github.com/nextcloud/client_updater_server/pull/36 */
|
||||
int updateSegment() const;
|
||||
[[nodiscard]] int updateSegment() const;
|
||||
|
||||
QString updateChannel() const;
|
||||
[[nodiscard]] QString updateChannel() const;
|
||||
void setUpdateChannel(const QString &channel);
|
||||
|
||||
void saveGeometryHeader(QHeaderView *header);
|
||||
void restoreGeometryHeader(QHeaderView *header);
|
||||
|
||||
QString certificatePath() const;
|
||||
[[nodiscard]] QString certificatePath() const;
|
||||
void setCertificatePath(const QString &cPath);
|
||||
QString certificatePasswd() const;
|
||||
[[nodiscard]] QString certificatePasswd() const;
|
||||
void setCertificatePasswd(const QString &cPasswd);
|
||||
|
||||
/** The client version that last used this settings file.
|
||||
Updated by configVersionMigration() at client startup. */
|
||||
QString clientVersionString() const;
|
||||
[[nodiscard]] QString clientVersionString() const;
|
||||
void setClientVersionString(const QString &version);
|
||||
|
||||
/** Returns a new settings pre-set in a specific group. The Settings will be created
|
||||
|
@ -207,18 +207,18 @@ public:
|
|||
static void setupDefaultExcludeFilePaths(ExcludedFiles &excludedFiles);
|
||||
|
||||
protected:
|
||||
QVariant getPolicySetting(const QString &policy, const QVariant &defaultValue = QVariant()) const;
|
||||
[[nodiscard]] QVariant getPolicySetting(const QString &policy, const QVariant &defaultValue = QVariant()) const;
|
||||
void storeData(const QString &group, const QString &key, const QVariant &value);
|
||||
QVariant retrieveData(const QString &group, const QString &key) const;
|
||||
[[nodiscard]] QVariant retrieveData(const QString &group, const QString &key) const;
|
||||
void removeData(const QString &group, const QString &key);
|
||||
bool dataExists(const QString &group, const QString &key) const;
|
||||
[[nodiscard]] bool dataExists(const QString &group, const QString &key) const;
|
||||
|
||||
private:
|
||||
QVariant getValue(const QString ¶m, const QString &group = QString(),
|
||||
[[nodiscard]] QVariant getValue(const QString ¶m, const QString &group = QString(),
|
||||
const QVariant &defaultValue = QVariant()) const;
|
||||
void setValue(const QString &key, const QVariant &value);
|
||||
|
||||
QString keychainProxyPasswordKey() const;
|
||||
[[nodiscard]] QString keychainProxyPasswordKey() const;
|
||||
|
||||
private:
|
||||
using SharedCreds = QSharedPointer<AbstractCredentials>;
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
explicit CookieJar(QObject *parent = nullptr);
|
||||
~CookieJar() override;
|
||||
bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url) override;
|
||||
QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const override;
|
||||
[[nodiscard]] QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const override;
|
||||
|
||||
void clearSessionCookies();
|
||||
|
||||
|
|
|
@ -43,16 +43,16 @@ public:
|
|||
*/
|
||||
virtual void setAccount(Account *account);
|
||||
|
||||
virtual QString authType() const = 0;
|
||||
virtual QString user() const = 0;
|
||||
virtual QString password() const = 0;
|
||||
virtual QNetworkAccessManager *createQNAM() const = 0;
|
||||
[[nodiscard]] virtual QString authType() const = 0;
|
||||
[[nodiscard]] virtual QString user() const = 0;
|
||||
[[nodiscard]] virtual QString password() const = 0;
|
||||
[[nodiscard]] virtual QNetworkAccessManager *createQNAM() const = 0;
|
||||
|
||||
/** Whether there are credentials that can be used for a connection attempt. */
|
||||
virtual bool ready() const = 0;
|
||||
[[nodiscard]] virtual bool ready() const = 0;
|
||||
|
||||
/** Whether fetchFromKeychain() was called before. */
|
||||
bool wasFetched() const { return _wasFetched; }
|
||||
[[nodiscard]] bool wasFetched() const { return _wasFetched; }
|
||||
|
||||
/** Trigger (async) fetching of credential information
|
||||
*
|
||||
|
|
|
@ -26,11 +26,11 @@ class OWNCLOUDSYNC_EXPORT DummyCredentials : public AbstractCredentials
|
|||
public:
|
||||
QString _user;
|
||||
QString _password;
|
||||
QString authType() const override;
|
||||
QString user() const override;
|
||||
QString password() const override;
|
||||
QNetworkAccessManager *createQNAM() const override;
|
||||
bool ready() const override;
|
||||
[[nodiscard]] QString authType() const override;
|
||||
[[nodiscard]] QString user() const override;
|
||||
[[nodiscard]] QString password() const override;
|
||||
[[nodiscard]] QNetworkAccessManager *createQNAM() const override;
|
||||
[[nodiscard]] bool ready() const override;
|
||||
bool stillValid(QNetworkReply *reply) override;
|
||||
void fetchFromKeychain() override;
|
||||
void askFromUser() override;
|
||||
|
|
|
@ -83,15 +83,15 @@ public:
|
|||
explicit HttpCredentials(const QString &user, const QString &password,
|
||||
const QByteArray &clientCertBundle = QByteArray(), const QByteArray &clientCertPassword = QByteArray());
|
||||
|
||||
QString authType() const override;
|
||||
QNetworkAccessManager *createQNAM() const override;
|
||||
bool ready() const override;
|
||||
[[nodiscard]] QString authType() const override;
|
||||
[[nodiscard]] QNetworkAccessManager *createQNAM() const override;
|
||||
[[nodiscard]] bool ready() const override;
|
||||
void fetchFromKeychain() override;
|
||||
bool stillValid(QNetworkReply *reply) override;
|
||||
void persist() override;
|
||||
QString user() const override;
|
||||
[[nodiscard]] QString user() const override;
|
||||
// the password or token
|
||||
QString password() const override;
|
||||
[[nodiscard]] QString password() const override;
|
||||
void invalidateToken() override;
|
||||
void forgetSensitiveData() override;
|
||||
QString fetchUser();
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
void setAccount(Account *account) override;
|
||||
|
||||
// Whether we are using OAuth
|
||||
bool isUsingOAuth() const { return !_refreshToken.isNull(); }
|
||||
[[nodiscard]] bool isUsingOAuth() const { return !_refreshToken.isNull(); }
|
||||
|
||||
bool retryIfNeeded(AbstractNetworkJob *) override;
|
||||
|
||||
|
|
|
@ -47,13 +47,13 @@ public:
|
|||
|
||||
~Job() override;
|
||||
|
||||
QKeychain::Error error() const;
|
||||
QString errorString() const;
|
||||
[[nodiscard]] QKeychain::Error error() const;
|
||||
[[nodiscard]] QString errorString() const;
|
||||
|
||||
QByteArray binaryData() const;
|
||||
QString textData() const;
|
||||
[[nodiscard]] QByteArray binaryData() const;
|
||||
[[nodiscard]] QString textData() const;
|
||||
|
||||
bool insecureFallback() const;
|
||||
[[nodiscard]] bool insecureFallback() const;
|
||||
|
||||
// If we use it but don't support insecure fallback, give us nice compilation errors ;p
|
||||
#if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
|
||||
|
@ -64,7 +64,7 @@ public:
|
|||
* @return Whether this job autodeletes itself once finished() has been emitted. Default is true.
|
||||
* @see setAutoDelete()
|
||||
*/
|
||||
bool autoDelete() const;
|
||||
[[nodiscard]] bool autoDelete() const;
|
||||
|
||||
/**
|
||||
* Set whether this job should autodelete itself once finished() has been emitted.
|
||||
|
|
|
@ -11,8 +11,8 @@ class OWNCLOUDSYNC_EXPORT DateTimeProvider
|
|||
public:
|
||||
virtual ~DateTimeProvider();
|
||||
|
||||
virtual QDateTime currentDateTime() const;
|
||||
[[nodiscard]] virtual QDateTime currentDateTime() const;
|
||||
|
||||
virtual QDate currentDate() const;
|
||||
[[nodiscard]] virtual QDate currentDate() const;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
|
||||
void start() override;
|
||||
|
||||
QByteArray folderToken() const;
|
||||
[[nodiscard]] QByteArray folderToken() const;
|
||||
void setFolderToken(const QByteArray &folderToken);
|
||||
|
||||
private:
|
||||
|
|
|
@ -96,7 +96,7 @@ public:
|
|||
_isInsideEncryptedTree = isInsideEncryptedTree;
|
||||
}
|
||||
|
||||
bool isInsideEncryptedTree() const
|
||||
[[nodiscard]] bool isInsideEncryptedTree() const
|
||||
{
|
||||
return _isInsideEncryptedTree;
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ private:
|
|||
{
|
||||
return base.isEmpty() ? name : base + QLatin1Char('/') + name;
|
||||
}
|
||||
PathTuple addName(const QString &name) const
|
||||
[[nodiscard]] PathTuple addName(const QString &name) const
|
||||
{
|
||||
PathTuple result;
|
||||
result._original = pathAppend(_original, name);
|
||||
|
@ -190,9 +190,9 @@ private:
|
|||
*/
|
||||
bool checkPermissions(const SyncFileItemPtr &item);
|
||||
|
||||
bool isAnyParentBeingRestored(const QString &file) const;
|
||||
[[nodiscard]] bool isAnyParentBeingRestored(const QString &file) const;
|
||||
|
||||
bool isRename(const QString &originalPath) const;
|
||||
[[nodiscard]] bool isRename(const QString &originalPath) const;
|
||||
|
||||
struct MovePermissionResult
|
||||
{
|
||||
|
@ -217,11 +217,11 @@ private:
|
|||
void dbError();
|
||||
|
||||
void addVirtualFileSuffix(QString &str) const;
|
||||
bool hasVirtualFileSuffix(const QString &str) const;
|
||||
[[nodiscard]] bool hasVirtualFileSuffix(const QString &str) const;
|
||||
void chopVirtualFileSuffix(QString &str) const;
|
||||
|
||||
/** Convenience to detect suffix-vfs modes */
|
||||
bool isVfsWithSuffix() const;
|
||||
[[nodiscard]] bool isVfsWithSuffix() const;
|
||||
|
||||
/** Start a remote discovery network job
|
||||
*
|
||||
|
|
|
@ -61,7 +61,7 @@ struct RemoteInfo
|
|||
bool isE2eEncrypted = false;
|
||||
QString e2eMangledName;
|
||||
|
||||
bool isValid() const { return !name.isNull(); }
|
||||
[[nodiscard]] bool isValid() const { return !name.isNull(); }
|
||||
|
||||
QString directDownloadUrl;
|
||||
QString directDownloadCookies;
|
||||
|
@ -88,7 +88,7 @@ struct LocalInfo
|
|||
bool isHidden = false;
|
||||
bool isVirtualFile = false;
|
||||
bool isSymLink = false;
|
||||
bool isValid() const { return !name.isNull(); }
|
||||
[[nodiscard]] bool isValid() const { return !name.isNull(); }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -222,7 +222,7 @@ class DiscoveryPhase : public QObject
|
|||
* Useful for avoiding processing of items that have already been claimed in
|
||||
* a rename (would otherwise be discovered as deletions).
|
||||
*/
|
||||
bool isRenamed(const QString &p) const { return _renamedItemsLocal.contains(p) || _renamedItemsRemote.contains(p); }
|
||||
[[nodiscard]] bool isRenamed(const QString &p) const { return _renamedItemsLocal.contains(p) || _renamedItemsRemote.contains(p); }
|
||||
|
||||
int _currentlyActiveJobs = 0;
|
||||
|
||||
|
@ -232,7 +232,7 @@ class DiscoveryPhase : public QObject
|
|||
|
||||
void scheduleMoreJobs();
|
||||
|
||||
bool isInSelectiveSyncBlackList(const QString &path) const;
|
||||
[[nodiscard]] bool isInSelectiveSyncBlackList(const QString &path) const;
|
||||
|
||||
// Check if the new folder should be deselected or not.
|
||||
// May be async. "Return" via the callback, true if the item is blacklisted
|
||||
|
@ -244,7 +244,7 @@ class DiscoveryPhase : public QObject
|
|||
* Note that it only considers parent directory renames. So if A/B got renamed to C/D,
|
||||
* checking A/B/file would yield C/D/file, but checking A/B would yield A/B.
|
||||
*/
|
||||
QString adjustRenamedPath(const QString &original, SyncFileItem::Direction) const;
|
||||
[[nodiscard]] QString adjustRenamedPath(const QString &original, SyncFileItem::Direction) const;
|
||||
|
||||
/** If the db-path is scheduled for deletion, abort it.
|
||||
*
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
explicit EncryptFolderJob(const AccountPtr &account, SyncJournalDb *journal, const QString &path, const QByteArray &fileId, QObject *parent = nullptr);
|
||||
void start();
|
||||
|
||||
QString errorString() const;
|
||||
[[nodiscard]] QString errorString() const;
|
||||
|
||||
signals:
|
||||
void finished(int status);
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
void startSyncPartialDiscovery();
|
||||
|
||||
/** Access list of files that shall be locally rediscovered. */
|
||||
const std::set<QString> &localDiscoveryPaths() const;
|
||||
[[nodiscard]] const std::set<QString> &localDiscoveryPaths() const;
|
||||
|
||||
public slots:
|
||||
/**
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue