Skip to content

Commit

Permalink
Merge branch 'nextcloud:master' into nmc/StyleSheet_Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TSI-pranalideshpande authored Jun 13, 2023
2 parents 3d40966 + 3c43be0 commit 5852068
Show file tree
Hide file tree
Showing 99 changed files with 6,025 additions and 5,528 deletions.
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ steps:
- cd /drone/build
- useradd -m -s /bin/bash test
- chown -R test:test .
- su -c 'ASAN_OPTIONS=detect_leaks=0 xvfb-run ctest --output-on-failure' test
- su -c 'ASAN_OPTIONS=detect_odr_violation=0,detect_leaks=0 xvfb-run ctest --output-on-failure' test

services:
- name: server
Expand Down Expand Up @@ -97,7 +97,7 @@ steps:
- cd /drone/build
- useradd -m -s /bin/bash test
- chown -R test:test .
- su -c 'ASAN_OPTIONS=detect_leaks=0 xvfb-run ctest --output-on-failure' test
- su -c 'ASAN_OPTIONS=detect_odr_violation=0,detect_leaks=0 xvfb-run ctest --output-on-failure' test

services:
- name: server
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/command-rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
issue_comment:
types: created

permissions:
contents: read
permissions:
contents: read

jobs:
rebase:
Expand All @@ -23,26 +23,26 @@ jobs:

steps:
- name: Add reaction on start
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
repository: ${{ github.event.repository.full_name }}
comment-id: ${{ github.event.comment.id }}
reaction-type: "+1"

- name: Checkout the latest code
uses: actions/checkout@v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
token: ${{ secrets.COMMAND_BOT_PAT }}

- name: Automatic Rebase
uses: cirrus-actions/rebase@1.7
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8
env:
GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}

- name: Add reaction on failure
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1
if: failure()
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/fixup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,31 @@
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Pull request checks
name: Block fixup and squash commits

on: pull_request
on:
pull_request:
types: [opened, ready_for_review, reopened, synchronize]

permissions:
contents: read

concurrency:
group: fixup-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
commit-message-check:
if: github.event.pull_request.draft == false

permissions:
pull-requests: write
name: Block fixup and squash commits

runs-on: ubuntu-latest

steps:
- name: Run check
uses: xt0rted/block-autosquash-commits-action@v2
uses: skjnldsv/block-fixup-merge-action@42d26e1b536ce61e5cf467d65fb76caf4aa85acf # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container: ghcr.io/nextcloud/continuous-integration-client:client-5.15-11
env:
SONAR_SERVER_URL: "https://sonarcloud.io"
Expand Down
2 changes: 2 additions & 0 deletions NEXTCLOUD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ option( WITH_PROVIDERS "Build with providers list" ON )

option( ENFORCE_VIRTUAL_FILES_SYNC_FOLDER "Enforce use of virtual files sync folder when available" OFF )

option(ENFORCE_SINGLE_ACCOUNT "Enforce use of a single account in desktop client" OFF)

option( DO_NOT_USE_PROXY "Do not use system wide proxy, instead always do a direct connection to server" OFF )

## Theming options
Expand Down
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define APPLICATION_URI_HANDLER_SCHEME "@APPLICATION_URI_HANDLER_SCHEME@"
#cmakedefine01 ENFORCE_VIRTUAL_FILES_SYNC_FOLDER
#cmakedefine DO_NOT_USE_PROXY "@DO_NOT_USE_PROXY@"
#cmakedefine ENFORCE_SINGLE_ACCOUNT "@ENFORCE_SINGLE_ACCOUNT@"

#cmakedefine ZLIB_FOUND @ZLIB_FOUND@

Expand Down
3 changes: 0 additions & 3 deletions src/common/pinstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

namespace OCC {

namespace PinStateEnums {
OCSYNC_EXPORT Q_NAMESPACE

/** Determines whether items should be available locally permanently or not
Expand Down Expand Up @@ -126,8 +125,6 @@ enum class VfsItemAvailability {
OnlineOnly = 4,
};
Q_ENUM_NS(VfsItemAvailability)
}
using namespace PinStateEnums;

}

Expand Down
2 changes: 2 additions & 0 deletions src/csync/csync_exclude.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ CSYNC_EXCLUDE_TYPE ExcludedFiles::traversalPatternMatch(const QString &path, Ite
addExcludeFilePath(absolutePath);
reloadExcludeFiles();
} else {
#if !defined QT_NO_DEBUG
qWarning() << "System exclude list file could not be read:" << absolutePath;
#endif
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/editlocallyjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ void EditLocallyJob::showErrorNotification(const QString &message, const QString
});

if (foundFolder != folderMap.cend()) {
emit (*foundFolder)->syncEngine().addErrorToGui(SyncFileItem::SoftError, message, informativeText);
emit (*foundFolder)->syncEngine().addErrorToGui(SyncFileItem::SoftError, message, informativeText, OCC::ErrorCategory::GenericError);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/filedetails/NCRadioButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RadioButton {
anchors.left: parent.left
anchors.leftMargin: Style.radioButtonCustomMarginLeftOuter
radius: root.radius
color: palette.base
border.color: palette.dark
border.width: Style.normalBorderWidth

Expand Down
10 changes: 5 additions & 5 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ void Folder::startSync(const QStringList &pathList)
_fileLog->start(path());

if (!reloadExcludes()) {
slotSyncError(tr("Could not read system exclude file"));
slotSyncError(tr("Could not read system exclude file"), ErrorCategory::GenericError);
QMetaObject::invokeMethod(this, "slotSyncFinished", Qt::QueuedConnection, Q_ARG(bool, false));
return;
}
Expand Down Expand Up @@ -1005,9 +1005,9 @@ void Folder::slotSyncError(const QString &message, ErrorCategory category)
}
}

void Folder::slotAddErrorToGui(SyncFileItem::Status status, const QString &errorMessage, const QString &subject)
void Folder::slotAddErrorToGui(SyncFileItem::Status status, const QString &errorMessage, const QString &subject, ErrorCategory category)
{
emit ProgressDispatcher::instance()->addErrorToGui(alias(), status, errorMessage, subject);
emit ProgressDispatcher::instance()->addErrorToGui(alias(), status, errorMessage, subject, category);
}

void Folder::slotSyncStarted()
Expand Down Expand Up @@ -1128,7 +1128,7 @@ void Folder::slotTransmissionProgress(const ProgressInfo &pi)
}

// a item is completed: count the errors and forward to the ProgressDispatcher
void Folder::slotItemCompleted(const SyncFileItemPtr &item)
void Folder::slotItemCompleted(const SyncFileItemPtr &item, ErrorCategory errorCategory)
{
if (item->_instruction == CSYNC_INSTRUCTION_NONE || item->_instruction == CSYNC_INSTRUCTION_UPDATE_METADATA) {
// We only care about the updates that deserve to be shown in the UI
Expand All @@ -1144,7 +1144,7 @@ void Folder::slotItemCompleted(const SyncFileItemPtr &item)
_syncResult.processCompletedItem(item);

_fileLog->logItem(*item);
emit ProgressDispatcher::instance()->itemCompleted(alias(), item);
emit ProgressDispatcher::instance()->itemCompleted(alias(), item, errorCategory);
}

void Folder::slotNewBigFolderDiscovered(const QString &newF, bool isExternal)
Expand Down
6 changes: 3 additions & 3 deletions src/gui/folder.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,12 @@ private slots:

/** Adds a error message that's not tied to a specific item.
*/
void slotSyncError(const QString &message, OCC::ErrorCategory category = OCC::ErrorCategory::Normal);
void slotSyncError(const QString &message, OCC::ErrorCategory category);

void slotAddErrorToGui(OCC::SyncFileItem::Status status, const QString &errorMessage, const QString &subject = {});
void slotAddErrorToGui(OCC::SyncFileItem::Status status, const QString &errorMessage, const QString &subject, OCC::ErrorCategory category);

void slotTransmissionProgress(const OCC::ProgressInfo &pi);
void slotItemCompleted(const OCC::SyncFileItemPtr &);
void slotItemCompleted(const OCC::SyncFileItemPtr &, OCC::ErrorCategory errorCategory);

void slotRunEtagJob();
void etagRetrieved(const QByteArray &, const QDateTime &tp);
Expand Down
5 changes: 5 additions & 0 deletions src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,11 @@ void ownCloudGui::slotLogout()

void ownCloudGui::slotNewAccountWizard()
{
#if defined ENFORCE_SINGLE_ACCOUNT
if (!AccountManager::instance()->accounts().isEmpty()) {
return;
}
#endif
OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
}

Expand Down
6 changes: 3 additions & 3 deletions src/gui/socketapi/socketapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void SocketApi::slotNewConnection()
if (!socket) {
return;
}
qCInfo(lcSocketApi) << "New connection" << socket;
qCDebug(lcSocketApi) << "New connection" << socket;
connect(socket, &QIODevice::readyRead, this, &SocketApi::slotReadSocket);
connect(socket, SIGNAL(disconnected()), this, SLOT(onLostConnection()));
connect(socket, &QObject::destroyed, this, &SocketApi::slotSocketDestroyed);
Expand All @@ -327,7 +327,7 @@ void SocketApi::slotNewConnection()
for (Folder *f : FolderMan::instance()->map()) {
if (f->canSync()) {
QString message = buildRegisterPathMessage(removeTrailingSlash(f->path()));
qCInfo(lcSocketApi) << "Trying to send SocketAPI Register Path Message -->" << message << "to" << listener->socket;
qCDebug(lcSocketApi) << "Trying to send SocketAPI Register Path Message -->" << message << "to" << listener->socket;
listener->sendMessage(message);
}
}
Expand Down Expand Up @@ -366,7 +366,7 @@ void SocketApi::slotReadSocket()
// Make sure to normalize the input from the socket to
// make sure that the path will match, especially on OS X.
const QString line = QString::fromUtf8(socket->readLine().trimmed()).normalized(QString::NormalizationForm_C);
qCInfo(lcSocketApi) << "Received SocketAPI message <--" << line << "from" << socket;
qCDebug(lcSocketApi) << "Received SocketAPI message <--" << line << "from" << socket;
const int argPos = line.indexOf(QLatin1Char(':'));
const QByteArray command = line.midRef(0, argPos).toUtf8().toUpper();
const int indexOfMethod = [&] {
Expand Down
9 changes: 9 additions & 0 deletions src/gui/systray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,15 @@ bool Systray::isOpen() const
return _isOpen;
}

bool Systray::enableAddAccount() const
{
#if defined ENFORCE_SINGLE_ACCOUNT
return AccountManager::instance()->accounts().isEmpty();
#else
return true;
#endif
}

void Systray::setIsOpen(const bool isOpen)
{
_isOpen = isOpen;
Expand Down
3 changes: 3 additions & 0 deletions src/gui/systray.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Systray
Q_PROPERTY(bool useNormalWindow READ useNormalWindow CONSTANT)
Q_PROPERTY(bool syncIsPaused READ syncIsPaused WRITE setSyncIsPaused NOTIFY syncIsPausedChanged)
Q_PROPERTY(bool isOpen READ isOpen WRITE setIsOpen NOTIFY isOpenChanged)
Q_PROPERTY(bool enableAddAccount READ enableAddAccount CONSTANT)

public:
static Systray *instance();
Expand All @@ -92,6 +93,8 @@ class Systray
Q_REQUIRED_RESULT bool syncIsPaused() const;
Q_REQUIRED_RESULT bool isOpen() const;

[[nodiscard]] bool enableAddAccount() const;

bool raiseDialogs();

signals:
Expand Down
4 changes: 4 additions & 0 deletions src/gui/tray/ActivityItemActions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Repeater {

property Flickable flickable

property bool talkReplyButtonVisible: true

signal triggerAction(int actionIndex)
signal showReplyField()

Expand Down Expand Up @@ -46,5 +48,7 @@ Repeater {
textColorHovered: Style.currentUserHeaderTextColor
contentsFont.bold: true
bgColor: Style.currentUserHeaderColor

visible: verb !== "REPLY" || (verb === "REPLY" && root.talkReplyButtonVisible)
}
}
7 changes: 4 additions & 3 deletions src/gui/tray/ActivityItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ RowLayout {
Layout.fillHeight: true
Layout.alignment: Qt.AlignTop | Qt.AlignLeft

text: (root.activityData.type === "Sync") ? root.activityData.displayPath
text: (root.activityData.type === "Sync") ? root.activityData.subject
: (root.activityData.type === "File") ? root.activityData.subject
: (root.activityData.type === "Notification") ? root.activityData.message
: ""
Expand Down Expand Up @@ -256,7 +256,7 @@ RowLayout {
ActivityItemActions {
id: activityActions

visible: !isFileActivityList && activityData.linksForActionButtons.length > 0 && !isTalkReplyOptionVisible
visible: !isFileActivityList && activityData.linksForActionButtons.length > 0

Layout.fillWidth: true
Layout.leftMargin: Style.trayListItemIconSize + Style.trayHorizontalMargin
Expand All @@ -270,9 +270,10 @@ RowLayout {

maxActionButtons: activityModel.maxActionButtons

onTriggerAction: activityModel.slotTriggerAction(model.activityIndex, actionIndex)
onTriggerAction: activityModel.slotTriggerAction(activityData.activityIndex, actionIndex)

onShowReplyField: isTalkReplyOptionVisible = true
talkReplyButtonVisible: root.activityData.messageSent === "" && !isTalkReplyOptionVisible
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/gui/tray/UnifiedSearchInputContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ TextField {

readonly property color textFieldIconsColor: palette.dark

readonly property color placeholderColor: palette.dark

readonly property int textFieldIconsOffset: Style.trayHorizontalMargin

readonly property double textFieldIconsScaleFactor: 0.6
Expand All @@ -39,6 +41,7 @@ TextField {
rightPadding: trayWindowUnifiedSearchTextFieldClearTextButton.width + trayWindowUnifiedSearchTextFieldClearTextButton.anchors.rightMargin + textFieldHorizontalPaddingOffset

placeholderText: qsTr("Search files, messages, events …")
placeholderTextColor: placeholderColor

selectByMouse: true

Expand Down
3 changes: 2 additions & 1 deletion src/gui/tray/Window.qml
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,9 @@ ApplicationWindow {

MenuItem {
id: addAccountButton
height: Style.addAccountButtonHeight
height: Systray.enableAddAccount ? Style.addAccountButtonHeight : 0
hoverEnabled: true
visible: Systray.enableAddAccount

background: Item {
height: parent.height
Expand Down
Loading

0 comments on commit 5852068

Please sign in to comment.