Merge remote-tracking branch 'origin/2.4'

This commit is contained in:
Christian Kamm 2017-12-13 11:03:24 +01:00
commit e5ed8fc90a
11 changed files with 54 additions and 15 deletions

View file

@ -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

View file

@ -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: {

View file

@ -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);

View file

@ -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());
}
}

View file

@ -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);

View file

@ -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);
}

View file

@ -24,6 +24,8 @@
#include <QUrl>
#define OCS_SUCCESS_STATUS_CODE 100
// Apparantly the v2.php URLs can return that
#define OCS_SUCCESS_STATUS_CODE_V2 200
class QJsonDocument;

View file

@ -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<AccountState *>(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);

View file

@ -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<quint32>::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<quint64>::max() - std::numeric_limits<quint32>::max() - 1;
record._type = 7;
record._etag = "789FFF";
record._fileId = "efg";

View file

@ -691,17 +691,17 @@
<message numerus="yes">
<location filename="../src/gui/folder.cpp" line="364"/>
<source>%1 and %n other file(s) have been removed.</source>
<translation><numerusform>%1 og %2 annen fil har blitt fjernet.</numerusform><numerusform>%1 og %2 andre filer har blitt fjernet.</numerusform></translation>
<translation><numerusform>%1 og %n annen fil har blitt fjernet.</numerusform><numerusform>%1 og %n andre filer har blitt fjernet.</numerusform></translation>
</message>
<message numerus="yes">
<location filename="../src/gui/folder.cpp" line="371"/>
<source>%1 and %n other file(s) have been downloaded.</source>
<translation><numerusform>%1 og %2 annen fil har blitt lastet ned.</numerusform><numerusform>%1 og %n andre filer har blitt lastet ned.</numerusform></translation>
<translation><numerusform>%1 og %n annen fil har blitt lastet ned.</numerusform><numerusform>%1 og %n andre filer har blitt lastet ned.</numerusform></translation>
</message>
<message numerus="yes">
<location filename="../src/gui/folder.cpp" line="378"/>
<source>%1 and %n other file(s) have been updated.</source>
<translation><numerusform>%1 og %2 annen fil har blitt oppdatert.</numerusform><numerusform>%1 og %n andre filer har blitt oppdatert.</numerusform></translation>
<translation><numerusform>%1 og %n annen fil har blitt oppdatert.</numerusform><numerusform>%1 og %n andre filer har blitt oppdatert.</numerusform></translation>
</message>
<message numerus="yes">
<location filename="../src/gui/folder.cpp" line="385"/>
@ -1408,7 +1408,7 @@ Elementer hvor sletting er tillatt, vil bli slettet hvis de forhindrer fjerning
<location filename="../src/gui/issueswidget.ui" line="42"/>
<location filename="../src/gui/issueswidget.ui" line="61"/>
<source>&lt;no filter&gt;</source>
<translation type="unfinished"/>
<translation>&lt;no filter&gt;</translation>
</message>
<message>
<location filename="../src/gui/issueswidget.ui" line="50"/>

View file

@ -243,7 +243,7 @@
<message>
<location filename="../src/gui/accountsettings.cpp" line="656"/>
<source>Server %1 is currently in maintenance mode.</source>
<translation type="unfinished"/>
<translation>Serwer %1 jest obecnie w trybie konserwacji.</translation>
</message>
<message>
<location filename="../src/gui/accountsettings.cpp" line="658"/>
@ -373,7 +373,7 @@
<message>
<location filename="../src/gui/accountstate.cpp" line="132"/>
<source>Maintenance mode</source>
<translation type="unfinished"/>
<translation>Tryb konserwacji</translation>
</message>
<message>
<location filename="../src/gui/accountstate.cpp" line="134"/>
@ -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.</source>
<translation type="unfinished"/>
<translation>Wszystkie pliki z folderu &apos;%1&apos; 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. </translation>
</message>
<message>
<location filename="../src/gui/folder.cpp" line="932"/>