diff --git a/mirall.desktop.in b/mirall.desktop.in index bed252012..79b65d54b 100644 --- a/mirall.desktop.in +++ b/mirall.desktop.in @@ -59,6 +59,24 @@ X-GNOME-Autostart-Delay=3 # Translations +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + # Translations Comment[oc]=@APPLICATION_NAME@ sincronizacion del client GenericName[oc]=Dorsièr de Sincronizacion diff --git a/src/common/ownsql.cpp b/src/common/ownsql.cpp index 55dbec40b..c4277a130 100644 --- a/src/common/ownsql.cpp +++ b/src/common/ownsql.cpp @@ -344,6 +344,7 @@ void SqlQuery::bindValue(int pos, const QVariant &value) break; case QVariant::UInt: case QVariant::LongLong: + case QVariant::ULongLong: res = sqlite3_bind_int64(_stmt, pos, value.toLongLong()); break; case QVariant::DateTime: { diff --git a/src/common/syncjournaldb.cpp b/src/common/syncjournaldb.cpp index 324cced6e..3710f36d3 100644 --- a/src/common/syncjournaldb.cpp +++ b/src/common/syncjournaldb.cpp @@ -45,7 +45,7 @@ Q_LOGGING_CATEGORY(lcDb, "sync.database", QtInfoMsg) static void fillFileRecordFromGetQuery(SyncJournalFileRecord &rec, SqlQuery &query) { rec._path = query.baValue(0); - rec._inode = query.intValue(1); + rec._inode = query.int64Value(1); rec._modtime = query.int64Value(2); rec._type = query.intValue(3); rec._etag = query.baValue(4); diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp index b089fef9b..8a29d9152 100644 --- a/src/gui/activitywidget.cpp +++ b/src/gui/activitywidget.cpp @@ -429,14 +429,13 @@ void ActivityWidget::slotNotifyServerFinished(const QString &reply, int replyCod } endNotificationRequest(job->widget(), replyCode); - // FIXME: remove the widget after a couple of seconds qCInfo(lcActivity) << "Server Notification reply code" << replyCode << reply; // if the notification was successful start a timer that triggers // removal of the done widgets in a few seconds // Add 200 millisecs to the predefined value to make sure that the timer in // widget's method readyToClose() has elapsed. - if (replyCode == OCS_SUCCESS_STATUS_CODE) { + if (replyCode == OCS_SUCCESS_STATUS_CODE || replyCode == OCS_SUCCESS_STATUS_CODE_V2) { scheduleWidgetToRemove(job->widget()); } } diff --git a/src/gui/notificationwidget.cpp b/src/gui/notificationwidget.cpp index dbf8c18ff..cd879451e 100644 --- a/src/gui/notificationwidget.cpp +++ b/src/gui/notificationwidget.cpp @@ -128,8 +128,8 @@ void NotificationWidget::slotNotificationRequestFinished(int statusCode) QString timeStr = locale.toString(QTime::currentTime()); - // the ocs API returns stat code 100 if it succeeded. - if (statusCode != OCS_SUCCESS_STATUS_CODE) { + // the ocs API returns stat code 100 or 200 inside the xml if it succeeded. + if (statusCode != OCS_SUCCESS_STATUS_CODE && statusCode != OCS_SUCCESS_STATUS_CODE_V2) { qCWarning(lcNotifications) << "Notification Request to Server failed, leave button visible."; for (i = 0; i < _buttons.count(); i++) { _buttons.at(i)->setEnabled(true); diff --git a/src/gui/ocsjob.cpp b/src/gui/ocsjob.cpp index fda6e90ae..6793bf09e 100644 --- a/src/gui/ocsjob.cpp +++ b/src/gui/ocsjob.cpp @@ -28,6 +28,7 @@ OcsJob::OcsJob(AccountPtr account) : AbstractNetworkJob(account, "") { _passStatusCodes.append(OCS_SUCCESS_STATUS_CODE); + _passStatusCodes.append(OCS_SUCCESS_STATUS_CODE_V2); setIgnoreCredentialFailure(true); } diff --git a/src/gui/ocsjob.h b/src/gui/ocsjob.h index 4560b3a36..4de4d701e 100644 --- a/src/gui/ocsjob.h +++ b/src/gui/ocsjob.h @@ -24,6 +24,8 @@ #include #define OCS_SUCCESS_STATUS_CODE 100 +// Apparantly the v2.php URLs can return that +#define OCS_SUCCESS_STATUS_CODE_V2 200 class QJsonDocument; diff --git a/src/gui/servernotificationhandler.cpp b/src/gui/servernotificationhandler.cpp index 7c69bf599..72b65b296 100644 --- a/src/gui/servernotificationhandler.cpp +++ b/src/gui/servernotificationhandler.cpp @@ -24,6 +24,8 @@ namespace OCC { Q_LOGGING_CATEGORY(lcServerNotification, "gui.servernotification", QtInfoMsg) +const QString notificationsPath = QLatin1String("ocs/v2.php/apps/notifications/api/v1/notifications"); + ServerNotificationHandler::ServerNotificationHandler(QObject *parent) : QObject(parent) { @@ -47,7 +49,7 @@ void ServerNotificationHandler::slotFetchNotifications(AccountState *ptr) } // if the previous notification job has finished, start next. - _notificationJob = new JsonApiJob(ptr->account(), QLatin1String("ocs/v2.php/apps/notifications/api/v1/notifications"), this); + _notificationJob = new JsonApiJob(ptr->account(), notificationsPath, this); QObject::connect(_notificationJob.data(), &JsonApiJob::jsonReceived, this, &ServerNotificationHandler::slotNotificationsReceived); _notificationJob->setProperty("AccountStatePtr", QVariant::fromValue(ptr)); @@ -94,6 +96,16 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j a._links.append(al); } + + // Add another action to dismiss notification on server + // https://github.com/owncloud/notifications/blob/master/docs/ocs-endpoint-v1.md#deleting-a-notification-for-a-user + ActivityLink al; + al._label = tr("Dismiss"); + al._link = Utility::concatUrlPath(ai->account()->url(), notificationsPath + "/" + json.value("notification_id").toString()).toString(); + al._verb = "DELETE"; + al._isPrimary = false; + a._links.append(al); + list.append(a); } emit newNotificationList(list); diff --git a/test/testsyncjournaldb.cpp b/test/testsyncjournaldb.cpp index 0575c0ed5..cb86a1655 100644 --- a/test/testsyncjournaldb.cpp +++ b/test/testsyncjournaldb.cpp @@ -50,7 +50,9 @@ private slots: QVERIFY(!record.isValid()); record._path = "foo"; - record._inode = 1234; + // Use a value that exceeds uint32 and isn't representable by the + // signed int being cast to uint64 either (like uint64::max would be) + record._inode = std::numeric_limits::max() + 12ull; record._modtime = dropMsecs(QDateTime::currentDateTime()); record._type = 5; record._etag = "789789"; @@ -71,8 +73,9 @@ private slots: QVERIFY(storedRecord == record); // Update metadata - record._inode = 12345; record._modtime = dropMsecs(QDateTime::currentDateTime().addDays(1)); + // try a value that only fits uint64, not int64 + record._inode = std::numeric_limits::max() - std::numeric_limits::max() - 1; record._type = 7; record._etag = "789FFF"; record._fileId = "efg"; diff --git a/translations/client_nb_NO.ts b/translations/client_nb_NO.ts index 4378f4d68..42c272b95 100644 --- a/translations/client_nb_NO.ts +++ b/translations/client_nb_NO.ts @@ -691,17 +691,17 @@ %1 and %n other file(s) have been removed. - %1 og %2 annen fil har blitt fjernet.%1 og %2 andre filer har blitt fjernet. + %1 og %n annen fil har blitt fjernet.%1 og %n andre filer har blitt fjernet. %1 and %n other file(s) have been downloaded. - %1 og %2 annen fil har blitt lastet ned.%1 og %n andre filer har blitt lastet ned. + %1 og %n annen fil har blitt lastet ned.%1 og %n andre filer har blitt lastet ned. %1 and %n other file(s) have been updated. - %1 og %2 annen fil har blitt oppdatert.%1 og %n andre filer har blitt oppdatert. + %1 og %n annen fil har blitt oppdatert.%1 og %n andre filer har blitt oppdatert. @@ -1408,7 +1408,7 @@ Elementer hvor sletting er tillatt, vil bli slettet hvis de forhindrer fjerning <no filter> - + <no filter> diff --git a/translations/client_pl.ts b/translations/client_pl.ts index 391a12088..515acd5b2 100644 --- a/translations/client_pl.ts +++ b/translations/client_pl.ts @@ -243,7 +243,7 @@ Server %1 is currently in maintenance mode. - + Serwer %1 jest obecnie w trybie konserwacji. @@ -373,7 +373,7 @@ Maintenance mode - + Tryb konserwacji @@ -768,7 +768,10 @@ These deletes will be synchronized to your local sync folder, making such files unavailable unless you have a right to restore. If you decide to keep the files, they will be re-synced with the server if you have rights to do so. If you decide to delete the files, they will be unavailable to you, unless you are the owner. - + Wszystkie pliki z folderu '%1' zostały usunięte z serwera. +W momencie synchronizacji zostaną usunięte z lokalnego katalogu, co spowoduje ich niedostępność, chyba, że posiadasz prawo do przywracania. +Jeśli zdecydujesz się zatrzymać pliki i posiadasz odpowiednie uprawnienia, zostaną one ponownie przesłane na serwer. +Jeśli zdecydujesz je usunąć, nie będą więcej dostępne.