Use auto to avoiding repeating type names
authorKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 18 May 2020 18:54:23 +0000 (20:54 +0200)
committerMichael Schuster <michael@schuster.ms>
Wed, 20 May 2020 01:54:41 +0000 (03:54 +0200)
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
65 files changed:
src/3rdparty/kmessagewidget/kmessagewidget.cpp
src/3rdparty/qtsingleapplication/qtsingleapplication.cpp
src/cmd/cmd.cpp
src/common/ownsql.cpp
src/gui/accountmanager.cpp
src/gui/accountsettings.cpp
src/gui/accountstate.cpp
src/gui/application.cpp
src/gui/authenticationdialog.cpp
src/gui/clientproxy.cpp
src/gui/connectionvalidator.cpp
src/gui/creds/httpcredentialsgui.cpp
src/gui/creds/keychainchunk.cpp
src/gui/creds/shibboleth/shibbolethwebview.cpp
src/gui/creds/shibbolethcredentials.cpp
src/gui/creds/webflowcredentials.cpp
src/gui/folderman.cpp
src/gui/folderstatusdelegate.cpp
src/gui/folderstatusmodel.cpp
src/gui/folderwizard.cpp
src/gui/ignorelisttablewidget.cpp
src/gui/logbrowser.cpp
src/gui/ocsjob.cpp
src/gui/owncloudgui.cpp
src/gui/owncloudsetupwizard.cpp
src/gui/proxyauthhandler.cpp
src/gui/selectivesyncdialog.cpp
src/gui/settingsdialog.cpp
src/gui/sharedialog.cpp
src/gui/sharee.cpp
src/gui/sharelinkwidget.cpp
src/gui/sharemanager.cpp
src/gui/shareusergroupwidget.cpp
src/gui/socketapi.cpp
src/gui/sslbutton.cpp
src/gui/sslerrordialog.cpp
src/gui/tooltipupdater.cpp
src/gui/tray/ActivityListModel.cpp
src/gui/tray/NotificationHandler.cpp
src/gui/tray/UserModel.cpp
src/gui/userinfo.cpp
src/gui/wizard/flow2authcredspage.cpp
src/gui/wizard/owncloudadvancedsetuppage.cpp
src/gui/wizard/owncloudhttpcredspage.cpp
src/gui/wizard/owncloudoauthcredspage.cpp
src/gui/wizard/owncloudsetuppage.cpp
src/gui/wizard/owncloudshibbolethcredspage.cpp
src/gui/wizard/webview.cpp
src/gui/wizard/webviewpage.cpp
src/libsync/account.cpp
src/libsync/bandwidthmanager.cpp
src/libsync/clientsideencryption.cpp
src/libsync/clientsideencryptionjobs.cpp
src/libsync/creds/httpcredentials.cpp
src/libsync/discoveryphase.cpp
src/libsync/networkjobs.cpp
src/libsync/owncloudpropagator.cpp
src/libsync/propagatedownload.cpp
src/libsync/propagateupload.cpp
src/libsync/propagateuploadng.cpp
src/libsync/propagateuploadv1.cpp
src/libsync/syncengine.cpp
test/testchecksumvalidator.cpp
test/testfolderman.cpp
test/testsyncengine.cpp

index c0166f622423b4d31d4c0ed164f3ab6453cfb27a..d2d0f12b76dc60813d194f63f33da798fabcc5ad 100644 (file)
@@ -91,7 +91,7 @@ void KMessageWidgetPrivate::init(KMessageWidget *q_ptr)
     QObject::connect(textLabel, &QLabel::linkActivated, q, &KMessageWidget::linkActivated);
     QObject::connect(textLabel, &QLabel::linkHovered, q, &KMessageWidget::linkHovered);
 
-    QAction *closeAction = new QAction(q);
+    auto *closeAction = new QAction(q);
     closeAction->setText(KMessageWidget::tr("&Close"));
     closeAction->setToolTip(KMessageWidget::tr("Close message"));
     closeAction->setIcon(QIcon(":/client/theme/close.svg")); // ivan: NC customization
@@ -115,7 +115,7 @@ void KMessageWidgetPrivate::createLayout()
     buttons.clear();
 
     Q_FOREACH (QAction *action, q->actions()) {
-        QToolButton *button = new QToolButton(content);
+        auto *button = new QToolButton(content);
         button->setDefaultAction(action);
         button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
         buttons.append(button);
@@ -127,7 +127,7 @@ void KMessageWidgetPrivate::createLayout()
     closeButton->setAutoRaise(buttons.isEmpty());
 
     if (wordWrap) {
-        QGridLayout *layout = new QGridLayout(content);
+        auto *layout = new QGridLayout(content);
         // Set alignment to make sure icon does not move down if text wraps
         layout->addWidget(iconLabel, 0, 0, 1, 1, Qt::AlignHCenter | Qt::AlignTop);
         layout->addWidget(textLabel, 0, 1);
@@ -137,7 +137,7 @@ void KMessageWidgetPrivate::createLayout()
             layout->addWidget(closeButton, 0, 2, 1, 1, Qt::AlignHCenter | Qt::AlignTop);
         } else {
             // Use an additional layout in row 1 for the buttons.
-            QHBoxLayout *buttonLayout = new QHBoxLayout;
+            auto *buttonLayout = new QHBoxLayout;
             buttonLayout->addStretch();
             Q_FOREACH (QToolButton *button, buttons) {
                 // For some reason, calling show() is necessary if wordwrap is true,
@@ -150,7 +150,7 @@ void KMessageWidgetPrivate::createLayout()
             layout->addItem(buttonLayout, 1, 0, 1, 2);
         }
     } else {
-        QHBoxLayout *layout = new QHBoxLayout(content);
+        auto *layout = new QHBoxLayout(content);
         layout->addWidget(iconLabel);
         layout->addWidget(textLabel);
 
index 5934d1cb38de56aa3a458207af2c4aef59c066f5..b1895a5a444baf230eedda3ce2f8ee54d880d645 100644 (file)
@@ -81,7 +81,7 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char *
 
     lockfile.open(QtLockedFile::ReadWrite);
     lockfile.lock(QtLockedFile::WriteLock);
-    qint64 *pids = static_cast<qint64 *>(instances->data());
+    auto *pids = static_cast<qint64 *>(instances->data());
     if (!created) {
         // Find the first instance that it still running
         // The whole list needs to be iterated in order to append to it
@@ -109,7 +109,7 @@ QtSingleApplication::~QtSingleApplication()
     lockfile.open(QtLockedFile::ReadWrite);
     lockfile.lock(QtLockedFile::WriteLock);
     // Rewrite array, removing current pid and previously crashed ones
-    qint64 *pids = static_cast<qint64 *>(instances->data());
+    auto *pids = static_cast<qint64 *>(instances->data());
     qint64 *newpids = pids;
     for (; *pids; ++pids) {
         if (*pids != appPid && isRunning(*pids))
@@ -122,7 +122,7 @@ QtSingleApplication::~QtSingleApplication()
 bool QtSingleApplication::event(QEvent *event)
 {
     if (event->type() == QEvent::FileOpen) {
-        QFileOpenEvent *foe = static_cast<QFileOpenEvent*>(event);
+        auto *foe = static_cast<QFileOpenEvent*>(event);
         emit fileOpenRequest(foe->file());
         return true;
     }
index 290c496a1c4815cb780d119cd09a7a9271bc81de..8f8026a07cf7778cb103f3a9f3d47a1a5f7c32ef 100644 (file)
@@ -437,9 +437,9 @@ int main(int argc, char **argv)
         }
     }
 
-    SimpleSslErrorHandler *sslErrorHandler = new SimpleSslErrorHandler;
+    auto *sslErrorHandler = new SimpleSslErrorHandler;
 
-    HttpCredentialsText *cred = new HttpCredentialsText(user, password);
+    auto *cred = new HttpCredentialsText(user, password);
 
     if (options.trustSSL) {
         cred->setSSLTrusted(true);
@@ -456,7 +456,7 @@ int main(int argc, char **argv)
         // 'dav' endpoint instead of the nonshib one (which still use the old chunking)
 
         QEventLoop loop;
-        JsonApiJob *job = new JsonApiJob(account, QLatin1String("ocs/v1.php/cloud/capabilities"));
+        auto *job = new JsonApiJob(account, QLatin1String("ocs/v1.php/cloud/capabilities"));
         QObject::connect(job, &JsonApiJob::jsonReceived, [&](const QJsonDocument &json) {
             auto caps = json.object().value("ocs").toObject().value("data").toObject().value("capabilities").toObject();
             qDebug() << "Server capabilities" << caps;
index 6aa3649c1db23133f44ce565e2b0101d1bb51a1f..937bcf9188d3946d9be50bb4aabead5aeca2ce55 100644 (file)
@@ -384,7 +384,7 @@ void SqlQuery::bindValue(int pos, const QVariant &value)
     case QVariant::String: {
         if (!value.toString().isNull()) {
             // lifetime of string == lifetime of its qvariant
-            const QString *str = static_cast<const QString *>(value.constData());
+            const auto *str = static_cast<const QString *>(value.constData());
             res = sqlite3_bind_text16(_stmt, pos, str->utf16(),
                 (str->size()) * sizeof(QChar), SQLITE_TRANSIENT);
         } else {
index eec375180b484d919388a71c7ddd69702ea98917..34c4cbc3e33ccba515ab73f9da9b02d592e3817e 100644 (file)
@@ -211,7 +211,7 @@ void AccountManager::saveAccountHelper(Account *acc, QSettings &settings, bool s
 
     // Save cookies.
     if (acc->_am) {
-        CookieJar *jar = qobject_cast<CookieJar *>(acc->_am->cookieJar());
+        auto *jar = qobject_cast<CookieJar *>(acc->_am->cookieJar());
         if (jar) {
             qCInfo(lcAccountManager) << "Saving cookies." << acc->cookieJarPath();
             jar->save(acc->cookieJarPath());
@@ -347,7 +347,7 @@ AccountPtr AccountManager::createAccount()
 
 void AccountManager::displayMnemonic(const QString& mnemonic)
 {
-    QDialog *widget = new QDialog;
+    auto *widget = new QDialog;
     Ui_Dialog ui;
     ui.setupUi(widget);
     widget->setWindowTitle(tr("End to end encryption mnemonic"));
index a8d07e9dbd6a839aa49255175a95e3d089c398f3..7be63b3f913f17ab2beea8ffe25da7cfc75baeda 100644 (file)
@@ -120,7 +120,7 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
     _model = new FolderStatusModel;
     _model->setAccountState(_accountState);
     _model->setParent(this);
-    FolderStatusDelegate *delegate = new FolderStatusDelegate;
+    auto *delegate = new FolderStatusDelegate;
     delegate->setParent(this);
 
     // Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
@@ -159,12 +159,12 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
     connect(_model, &QAbstractItemModel::rowsInserted,
         this, &AccountSettings::refreshSelectiveSyncStatus);
 
-    QAction *syncNowAction = new QAction(this);
+    auto *syncNowAction = new QAction(this);
     syncNowAction->setShortcut(QKeySequence(Qt::Key_F6));
     connect(syncNowAction, &QAction::triggered, this, &AccountSettings::slotScheduleCurrentFolder);
     addAction(syncNowAction);
 
-    QAction *syncNowWithRemoteDiscovery = new QAction(this);
+    auto *syncNowWithRemoteDiscovery = new QAction(this);
     syncNowWithRemoteDiscovery->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_F6));
     connect(syncNowWithRemoteDiscovery, &QAction::triggered, this, &AccountSettings::slotScheduleCurrentFolderForceRemoteDiscovery);
     addAction(syncNowWithRemoteDiscovery);
@@ -215,7 +215,7 @@ void AccountSettings::slotNewMnemonicGenerated()
 {
     _ui->encryptionMessage->setText(tr("This account supports end-to-end encryption"));
 
-    QAction *mnemonic = new QAction(tr("Enable encryption"), this);
+    auto *mnemonic = new QAction(tr("Enable encryption"), this);
     connect(mnemonic, &QAction::triggered, this, &AccountSettings::requesetMnemonic);
     connect(mnemonic, &QAction::triggered, _ui->encryptionMessage, &KMessageWidget::hide);
 
@@ -595,7 +595,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
     bool folderConnected = _model->data(index, FolderStatusDelegate::FolderAccountConnected).toBool();
     auto folderMan = FolderMan::instance();
 
-    QMenu *menu = new QMenu(tv);
+    auto *menu = new QMenu(tv);
 
     menu->setAttribute(Qt::WA_DeleteOnClose);
 
@@ -668,7 +668,7 @@ void AccountSettings::slotAddFolder()
     FolderMan *folderMan = FolderMan::instance();
     folderMan->setSyncEnabled(false); // do not start more syncs.
 
-    FolderWizard *folderWizard = new FolderWizard(_accountState->account(), this);
+    auto *folderWizard = new FolderWizard(_accountState->account(), this);
 
     connect(folderWizard, &QDialog::accepted, this, &AccountSettings::slotFolderWizardAccepted);
     connect(folderWizard, &QDialog::rejected, this, &AccountSettings::slotFolderWizardRejected);
@@ -678,7 +678,7 @@ void AccountSettings::slotAddFolder()
 
 void AccountSettings::slotFolderWizardAccepted()
 {
-    FolderWizard *folderWizard = qobject_cast<FolderWizard *>(sender());
+    auto *folderWizard = qobject_cast<FolderWizard *>(sender());
     FolderMan *folderMan = FolderMan::instance();
 
     qCInfo(lcAccountSettings) << "Folder wizard completed";
index 90eec6275081d16372cb742b86d3ee08d3260e9e..6802dcf7f854fcb79f9d94caf299ef445be8ebc8 100644 (file)
@@ -236,7 +236,7 @@ void AccountState::checkConnectivity()
         return;
     }
 
-    ConnectionValidator *conValidator = new ConnectionValidator(AccountStatePtr(this));
+    auto *conValidator = new ConnectionValidator(AccountStatePtr(this));
     _connectionValidator = conValidator;
     connect(conValidator, &ConnectionValidator::connectionResult,
         this, &AccountState::slotConnectionValidatorResult);
@@ -419,7 +419,7 @@ std::unique_ptr<QSettings> AccountState::settings()
 }
 
 void AccountState::fetchNavigationApps(){
-    OcsNavigationAppsJob *job = new OcsNavigationAppsJob(_account);
+    auto *job = new OcsNavigationAppsJob(_account);
     job->addRawHeader("If-None-Match", navigationAppsEtagResponseHeader());
     connect(job, &OcsNavigationAppsJob::appsJobFinished, this, &AccountState::slotNavigationAppsFetched);
     connect(job, &OcsNavigationAppsJob::etagResponseHeaderReceived, this, &AccountState::slotEtagResponseHeaderReceived);
@@ -456,7 +456,7 @@ void AccountState::slotNavigationAppsFetched(const QJsonDocument &reply, int sta
                     foreach (const QJsonValue &value, navLinks) {
                         auto navLink = value.toObject();
 
-                        AccountApp *app = new AccountApp(navLink.value("name").toString(), QUrl(navLink.value("href").toString()),
+                        auto *app = new AccountApp(navLink.value("name").toString(), QUrl(navLink.value("href").toString()),
                             navLink.value("id").toString(), QUrl(navLink.value("icon").toString()));
 
                         _apps << app;
index 7d7cf85b3acd6c62e326c72cfb5d3f85e6a4ceeb..9083924fc2d4e332535ba87fa9de26c35fe7f2fa 100644 (file)
@@ -608,9 +608,9 @@ void Application::setupTranslations()
     if (!enforcedLocale.isEmpty())
         uiLanguages.prepend(enforcedLocale);
 
-    QTranslator *translator = new QTranslator(this);
-    QTranslator *qtTranslator = new QTranslator(this);
-    QTranslator *qtkeychainTranslator = new QTranslator(this);
+    auto *translator = new QTranslator(this);
+    auto *qtTranslator = new QTranslator(this);
+    auto *qtkeychainTranslator = new QTranslator(this);
 
     foreach (QString lang, uiLanguages) {
         lang.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973
index 80fea6321c140157cf990c6d10abc7ee0b3cac9c..c04176e1582d10948604af29700b66fe50a2328f 100644 (file)
@@ -28,18 +28,18 @@ AuthenticationDialog::AuthenticationDialog(const QString &realm, const QString &
     , _password(new QLineEdit)
 {
     setWindowTitle(tr("Authentication Required"));
-    QVBoxLayout *lay = new QVBoxLayout(this);
-    QLabel *label = new QLabel(tr("Enter username and password for '%1' at %2.").arg(realm, domain));
+    auto *lay = new QVBoxLayout(this);
+    auto *label = new QLabel(tr("Enter username and password for '%1' at %2.").arg(realm, domain));
     label->setTextFormat(Qt::PlainText);
     lay->addWidget(label);
 
-    QFormLayout *form = new QFormLayout;
+    auto *form = new QFormLayout;
     form->addRow(tr("&User:"), _user);
     form->addRow(tr("&Password:"), _password);
     lay->addLayout(form);
     _password->setEchoMode(QLineEdit::Password);
 
-    QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
+    auto *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
     connect(box, &QDialogButtonBox::accepted, this, &QDialog::accept);
     connect(box, &QDialogButtonBox::rejected, this, &QDialog::reject);
     lay->addWidget(box);
index 657a93538a420871083f2972c70d1d3945b469be..d9f851d1a2830a498d64d99e97648b3f8ee50fc6 100644 (file)
@@ -130,7 +130,7 @@ const char *ClientProxy::proxyTypeToCStr(QNetworkProxy::ProxyType type)
 
 void ClientProxy::lookupSystemProxyAsync(const QUrl &url, QObject *dst, const char *slot)
 {
-    SystemProxyRunnable *runnable = new SystemProxyRunnable(url);
+    auto *runnable = new SystemProxyRunnable(url);
     QObject::connect(runnable, SIGNAL(systemProxyLookedUp(QNetworkProxy)), dst, slot);
     QThreadPool::globalInstance()->start(runnable); // takes ownership and deletes
 }
index 3b9f8f4cadbc37efc2eb62ef92e2e147aa8637ee..eab6479dabb0d87ac3afc6606ce066cd4472f656 100644 (file)
@@ -88,7 +88,7 @@ void ConnectionValidator::systemProxyLookupDone(const QNetworkProxy &proxy)
 // The actual check
 void ConnectionValidator::slotCheckServerAndAuth()
 {
-    CheckServerJob *checkJob = new CheckServerJob(_account, this);
+    auto *checkJob = new CheckServerJob(_account, this);
     checkJob->setTimeout(timeoutToUseMsec);
     checkJob->setIgnoreCredentialFailure(true);
     connect(checkJob, &CheckServerJob::instanceFound, this, &ConnectionValidator::slotStatusFound);
@@ -173,7 +173,7 @@ void ConnectionValidator::checkAuthentication()
     // simply GET the webdav root, will fail if credentials are wrong.
     // continue in slotAuthCheck here :-)
     qCDebug(lcConnectionValidator) << "# Check whether authenticated propfind works.";
-    PropfindJob *job = new PropfindJob(_account, "/", this);
+    auto *job = new PropfindJob(_account, "/", this);
     job->setTimeout(timeoutToUseMsec);
     job->setProperties(QList<QByteArray>() << "getlastmodified");
     connect(job, &PropfindJob::result, this, &ConnectionValidator::slotAuthSuccess);
@@ -223,7 +223,7 @@ void ConnectionValidator::slotAuthSuccess()
 void ConnectionValidator::checkServerCapabilities()
 {
     // The main flow now needs the capabilities
-    JsonApiJob *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/capabilities"), this);
+    auto *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/capabilities"), this);
     job->setTimeout(timeoutToUseMsec);
     QObject::connect(job, &JsonApiJob::jsonReceived, this, &ConnectionValidator::slotCapabilitiesRecieved);
     job->start();
@@ -273,7 +273,7 @@ void ConnectionValidator::ocsConfigReceived(const QJsonDocument &json, AccountPt
 
 void ConnectionValidator::fetchUser()
 {
-    UserInfo *userInfo = new UserInfo(_accountState.data(), true, true, this);
+    auto *userInfo = new UserInfo(_accountState.data(), true, true, this);
     QObject::connect(userInfo, &UserInfo::fetchedLastInfo, this, &ConnectionValidator::slotUserFetched);
     userInfo->setActive(true);
 }
index a59d05ea5c460d93c35fa9fbcd396af31812f29f..cf8261c97027ee3f6cfc3819a08ffa43afb45b0d 100644 (file)
@@ -121,7 +121,7 @@ void HttpCredentialsGui::showDialog()
     dialog.setLabelText(msg);
     dialog.setTextValue(_previousPassword);
     dialog.setTextEchoMode(QLineEdit::Password);
-    if (QLabel *dialogLabel = dialog.findChild<QLabel *>()) {
+    if (auto *dialogLabel = dialog.findChild<QLabel *>()) {
         dialogLabel->setOpenExternalLinks(true);
         dialogLabel->setTextFormat(Qt::RichText);
     }
index ceacd27d7c938723cf8b482cc49b8e1d280e9f7d..cd6d3257f2dcce4a41f8db9150c5f9cdfec31322 100644 (file)
@@ -68,7 +68,7 @@ void WriteJob::start()
 
 void WriteJob::slotWriteJobDone(QKeychain::Job *incomingJob)
 {
-    QKeychain::WritePasswordJob *writeJob = static_cast<QKeychain::WritePasswordJob *>(incomingJob);
+    auto *writeJob = static_cast<QKeychain::WritePasswordJob *>(incomingJob);
 
     // errors?
     if (writeJob) {
@@ -114,7 +114,7 @@ void WriteJob::slotWriteJobDone(QKeychain::Job *incomingJob)
             _key + (index > 0 ? (QString(".") + QString::number(index)) : QString()),
             _account->id());
 
-        QKeychain::WritePasswordJob *job = new QKeychain::WritePasswordJob(_serviceName);
+        auto *job = new QKeychain::WritePasswordJob(_serviceName);
 #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
         addSettingsToJob(_account, job);
 #endif
@@ -158,7 +158,7 @@ void ReadJob::start()
         _key,
         _keychainMigration ? QString() : _account->id());
 
-    QKeychain::ReadPasswordJob *job = new QKeychain::ReadPasswordJob(_serviceName);
+    auto *job = new QKeychain::ReadPasswordJob(_serviceName);
 #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
     addSettingsToJob(_account, job);
 #endif
@@ -171,7 +171,7 @@ void ReadJob::start()
 void ReadJob::slotReadJobDone(QKeychain::Job *incomingJob)
 {
     // Errors or next chunk?
-    QKeychain::ReadPasswordJob *readJob = static_cast<QKeychain::ReadPasswordJob *>(incomingJob);
+    auto *readJob = static_cast<QKeychain::ReadPasswordJob *>(incomingJob);
 
     if (readJob) {
         if (readJob->error() == NoError && readJob->binaryData().length() > 0) {
index 8e4465b3c63f8f9f5bbaf00a7d7723af1a3fee4a..1fb0a7b462e68706e34a5c4a1b4b5e962fc27bc9 100644 (file)
@@ -87,9 +87,9 @@ ShibbolethWebView::ShibbolethWebView(AccountPtr account, QWidget *parent)
         // open an additional window to display some cipher debug info
         QWebPage *debugPage = new UserAgentWebPage(this);
         debugPage->mainFrame()->load(QUrl("https://cc.dcsec.uni-hannover.de/"));
-        QWebView *debugView = new QWebView(this);
+        auto *debugView = new QWebView(this);
         debugView->setPage(debugPage);
-        QMainWindow *window = new QMainWindow(this);
+        auto *window = new QMainWindow(this);
         window->setWindowTitle(tr("SSL Cipher Debug View"));
         window->setCentralWidget(debugView);
         window->show();
index a9766f8c6f34a6b3a7d4a325a607107a94e8da84..a09136a9789b0b1ae721e11083c98914669466c9 100644 (file)
@@ -141,7 +141,7 @@ void ShibbolethCredentials::fetchFromKeychain()
 
 void ShibbolethCredentials::fetchFromKeychainHelper()
 {
-    ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
+    auto *job = new ReadPasswordJob(Theme::instance()->appName());
     job->setSettings(ConfigFile::settingsWithGroup(Theme::instance()->appName(), job).release());
     job->setInsecureFallback(false);
     job->setKey(keychainKey(_url.toString(), user(),
@@ -153,7 +153,7 @@ void ShibbolethCredentials::fetchFromKeychainHelper()
 void ShibbolethCredentials::askFromUser()
 {
     // First, we do a DetermineAuthTypeJob to make sure that the server is still using shibboleth and did not upgrade to oauth
-    DetermineAuthTypeJob *job = new DetermineAuthTypeJob(_account->sharedFromThis(), this);
+    auto *job = new DetermineAuthTypeJob(_account->sharedFromThis(), this);
     connect(job, &DetermineAuthTypeJob::authType, [this, job](DetermineAuthTypeJob::AuthType type) {
         if (type == DetermineAuthTypeJob::Shibboleth) {
             // Normal case, still shibboleth
@@ -197,7 +197,7 @@ void ShibbolethCredentials::invalidateToken()
 {
     _ready = false;
 
-    CookieJar *jar = static_cast<CookieJar *>(_account->networkAccessManager()->cookieJar());
+    auto *jar = static_cast<CookieJar *>(_account->networkAccessManager()->cookieJar());
 
     // Remove the _shibCookie
     auto cookies = jar->allCookies();
@@ -234,7 +234,7 @@ void ShibbolethCredentials::slotFetchUser()
 {
     // We must first do a request to webdav so the session is enabled.
     // (because for some reason we can't access the API without that..  a bug in the server maybe?)
-    EntityExistsJob *job = new EntityExistsJob(_account->sharedFromThis(), _account->davPath(), this);
+    auto *job = new EntityExistsJob(_account->sharedFromThis(), _account->davPath(), this);
     connect(job, &EntityExistsJob::exists, this, &ShibbolethCredentials::slotFetchUserHelper);
     job->setIgnoreCredentialFailure(true);
     job->start();
@@ -242,7 +242,7 @@ void ShibbolethCredentials::slotFetchUser()
 
 void ShibbolethCredentials::slotFetchUserHelper()
 {
-    ShibbolethUserJob *job = new ShibbolethUserJob(_account->sharedFromThis(), this);
+    auto *job = new ShibbolethUserJob(_account->sharedFromThis(), this);
     connect(job, &ShibbolethUserJob::userFetched, this, &ShibbolethCredentials::slotUserFetched);
     job->start();
 }
@@ -287,7 +287,7 @@ void ShibbolethCredentials::slotReadJobDone(QKeychain::Job *job)
     }
 
     if (job->error() == QKeychain::NoError) {
-        ReadPasswordJob *readJob = static_cast<ReadPasswordJob *>(job);
+        auto *readJob = static_cast<ReadPasswordJob *>(job);
         delete readJob->settings();
         QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(readJob->textData().toUtf8());
         if (cookies.count() > 0) {
@@ -310,7 +310,7 @@ void ShibbolethCredentials::slotReadJobDone(QKeychain::Job *job)
     if (_keychainMigration && _ready) {
         persist();
 
-        DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
+        auto *job = new DeletePasswordJob(Theme::instance()->appName());
         job->setSettings(ConfigFile::settingsWithGroup(Theme::instance()->appName(), job).release());
         job->setKey(keychainKey(_account->url().toString(), user(), QString()));
         job->start();
@@ -326,7 +326,7 @@ void ShibbolethCredentials::showLoginWindow()
         return;
     }
 
-    CookieJar *jar = static_cast<CookieJar *>(_account->networkAccessManager()->cookieJar());
+    auto *jar = static_cast<CookieJar *>(_account->networkAccessManager()->cookieJar());
     // When opening a new window clear all the session cookie that might keep the user from logging in
     // (or the session may already be open in the server, and there will not be redirect asking for the
     // real long term cookie we want to store)
@@ -366,7 +366,7 @@ QByteArray ShibbolethCredentials::shibCookieName()
 
 void ShibbolethCredentials::storeShibCookie(const QNetworkCookie &cookie)
 {
-    WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+    auto *job = new WritePasswordJob(Theme::instance()->appName());
     job->setSettings(ConfigFile::settingsWithGroup(Theme::instance()->appName(), job).release());
     // we don't really care if it works...
     //connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotWriteJobDone(QKeychain::Job*)));
@@ -377,7 +377,7 @@ void ShibbolethCredentials::storeShibCookie(const QNetworkCookie &cookie)
 
 void ShibbolethCredentials::removeShibCookie()
 {
-    DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
+    auto *job = new DeletePasswordJob(Theme::instance()->appName());
     job->setSettings(ConfigFile::settingsWithGroup(Theme::instance()->appName(), job).release());
     job->setKey(keychainKey(_account->url().toString(), user(), _account->id()));
     job->start();
index fb85fc5d2a2720a01ad8d5ac118f354aa9236b56..16d4ccd621b172bfde9603933e0337b2193c3c19 100644 (file)
@@ -152,7 +152,7 @@ void WebFlowCredentials::fetchFromKeychain() {
 void WebFlowCredentials::askFromUser() {
     // Determine if the old flow has to be used (GS for now)
     // Do a DetermineAuthTypeJob to make sure that the server is still using Flow2
-    DetermineAuthTypeJob *job = new DetermineAuthTypeJob(_account->sharedFromThis(), this);
+    auto *job = new DetermineAuthTypeJob(_account->sharedFromThis(), this);
     connect(job, &DetermineAuthTypeJob::authType, [this](DetermineAuthTypeJob::AuthType type) {
         // LoginFlowV2 > WebViewFlow > OAuth > Shib > Basic
         bool useFlow2 = (type != DetermineAuthTypeJob::WebViewFlow);
@@ -340,7 +340,7 @@ void WebFlowCredentials::slotWriteClientCaCertsPEMJobDone(KeychainChunk::WriteJo
     }
 
     // done storing ca certs, time for the password
-    WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+    auto *job = new WritePasswordJob(Theme::instance()->appName());
 #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
     addSettingsToJob(_account, job);
 #endif
@@ -360,7 +360,7 @@ void WebFlowCredentials::slotWriteJobDone(QKeychain::Job *job)
     default:
         qCWarning(lcWebFlowCredentials) << "Error while writing password" << job->errorString();
     }
-    WritePasswordJob *wjob = qobject_cast<WritePasswordJob *>(job);
+    auto *wjob = qobject_cast<WritePasswordJob *>(job);
     wjob->deleteLater();
 }
 
@@ -390,11 +390,11 @@ void WebFlowCredentials::forgetSensitiveData() {
         return;
     }
 
-    DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
+    auto *job = new DeletePasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     connect(job, &Job::finished, this, [](QKeychain::Job *job) {
-        DeletePasswordJob *djob = qobject_cast<DeletePasswordJob *>(job);
+        auto *djob = qobject_cast<DeletePasswordJob *>(job);
         djob->deleteLater();
     });
     job->start();
@@ -565,7 +565,7 @@ void WebFlowCredentials::slotReadClientCaCertsPEMJobDone(KeychainChunk::ReadJob
         _user,
         _keychainMigration ? QString() : _account->id());
 
-    ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
+    auto *job = new ReadPasswordJob(Theme::instance()->appName());
 #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
     addSettingsToJob(_account, job);
 #endif
@@ -576,7 +576,7 @@ void WebFlowCredentials::slotReadClientCaCertsPEMJobDone(KeychainChunk::ReadJob
 }
 
 void WebFlowCredentials::slotReadPasswordJobDone(Job *incomingJob) {
-    QKeychain::ReadPasswordJob *job = qobject_cast<ReadPasswordJob *>(incomingJob);
+    auto *job = qobject_cast<ReadPasswordJob *>(incomingJob);
     QKeychain::Error error = job->error();
 
     // If we could not find the entry try the old entries
@@ -612,7 +612,7 @@ void WebFlowCredentials::slotReadPasswordJobDone(Job *incomingJob) {
 
 void WebFlowCredentials::deleteKeychainEntries(bool oldKeychainEntries) {
     auto startDeleteJob = [this, oldKeychainEntries](QString key) {
-        DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
+        auto *job = new DeletePasswordJob(Theme::instance()->appName());
 #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
         addSettingsToJob(_account, job);
 #endif
@@ -622,7 +622,7 @@ void WebFlowCredentials::deleteKeychainEntries(bool oldKeychainEntries) {
                                 oldKeychainEntries ? QString() : _account->id()));
 
         connect(job, &Job::finished, this, [](QKeychain::Job *job) {
-            DeletePasswordJob *djob = qobject_cast<DeletePasswordJob *>(job);
+            auto *djob = qobject_cast<DeletePasswordJob *>(job);
             djob->deleteLater();
         });
         job->start();
index 88b112928ad96b1740f1cccda7d32806142484fc..71f991c719d9477df5dcde567c3b5b676489ce0b 100644 (file)
@@ -463,7 +463,7 @@ void FolderMan::slotFolderSyncPaused(Folder *f, bool paused)
 
 void FolderMan::slotFolderCanSyncChanged()
 {
-    Folder *f = qobject_cast<Folder *>(sender());
+    auto *f = qobject_cast<Folder *>(sender());
      ASSERT(f);
     if (f->canSync()) {
         _socketApi->slotRegisterPath(f->alias());
@@ -608,7 +608,7 @@ void FolderMan::slotRunOneEtagJob()
 
 void FolderMan::slotAccountStateChanged()
 {
-    AccountState *accountState = qobject_cast<AccountState *>(sender());
+    auto *accountState = qobject_cast<AccountState *>(sender());
     if (!accountState) {
         return;
     }
@@ -790,7 +790,7 @@ void FolderMan::slotRemoveFoldersForAccount(AccountState *accountState)
 
 void FolderMan::slotForwardFolderSyncStateChange()
 {
-    if (Folder *f = qobject_cast<Folder *>(sender())) {
+    if (auto *f = qobject_cast<Folder *>(sender())) {
         emit folderSyncStateChange(f);
     }
 }
@@ -1378,7 +1378,7 @@ QString FolderMan::checkPathValidityForNewFolder(const QString &path, const QUrl
 
     const QString userDir = QDir::cleanPath(canonicalPath(path)) + '/';
     for (auto i = _folderMap.constBegin(); i != _folderMap.constEnd(); ++i) {
-        Folder *f = static_cast<Folder *>(i.value());
+        auto *f = static_cast<Folder *>(i.value());
         QString folderDir = QDir::cleanPath(canonicalPath(f->path())) + '/';
 
         bool differentPaths = QString::compare(folderDir, userDir, cs) != 0;
index d7ba865a49715046cc9526d2316f19bff70c839a..9aa41e74eafc15145621ba647186098281bd35d8 100644 (file)
@@ -372,8 +372,8 @@ bool FolderStatusDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
     switch (event->type()) {
     case QEvent::MouseButtonPress:
     case QEvent::MouseMove:
-        if (const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(option.widget)) {
-            QMouseEvent *me = static_cast<QMouseEvent *>(event);
+        if (const auto *view = qobject_cast<const QAbstractItemView *>(option.widget)) {
+            auto *me = static_cast<QMouseEvent *>(event);
             QModelIndex index;
             if (me->buttons()) {
                 index = view->indexAt(me->pos());
index 3f0d20adf67c37466dbd40e87900be9eee93940a..ef773f555c69da7567e11b551f6f240ab3130e75 100644 (file)
@@ -286,7 +286,7 @@ bool FolderStatusModel::setData(const QModelIndex &index, const QVariant &value,
 {
     if (role == Qt::CheckStateRole) {
         auto info = infoForIndex(index);
-        Qt::CheckState checked = static_cast<Qt::CheckState>(value.toInt());
+        auto checked = static_cast<Qt::CheckState>(value.toInt());
 
         if (info && info->_checked != checked) {
             info->_checked = checked;
@@ -589,7 +589,7 @@ void FolderStatusModel::fetchMore(const QModelIndex &parent)
                        _accountState->account()->e2e()->fetchFolderEncryptedStatus();
                }
 
-    LsColJob *job = new LsColJob(_accountState->account(), path, this);
+    auto *job = new LsColJob(_accountState->account(), path, this);
     info->_fetchingJob = job;
     job->setProperties(QList<QByteArray>() << "resourcetype"
                                            << "http://owncloud.org/ns:size"
@@ -893,7 +893,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress)
         return; // for https://github.com/owncloud/client/issues/2648#issuecomment-71377909
     }
 
-    Folder *f = qobject_cast<Folder *>(sender());
+    auto *f = qobject_cast<Folder *>(sender());
     if (!f) {
         return;
     }
index fce3dcf7fafe2fcfe23bf31ccff2a3eb30f8019e..1f51a30208379b169a26d3b8f859ac964066d0d6 100644 (file)
@@ -178,7 +178,7 @@ void FolderWizardRemotePath::slotAddRemoteFolder()
         parent = current->data(0, Qt::UserRole).toString();
     }
 
-    QInputDialog *dlg = new QInputDialog(this);
+    auto *dlg = new QInputDialog(this);
 
     dlg->setWindowTitle(tr("Create Remote Folder"));
     dlg->setLabelText(tr("Enter the name of the new folder to be created below '%1':")
@@ -199,7 +199,7 @@ void FolderWizardRemotePath::slotCreateRemoteFolder(const QString &folder)
     }
     fullPath += "/" + folder;
 
-    MkColJob *job = new MkColJob(_account, fullPath, this);
+    auto *job = new MkColJob(_account, fullPath, this);
     /* check the owncloud configuration file and query the ownCloud */
     connect(job, static_cast<void (MkColJob::*)(QNetworkReply::NetworkError)>(&MkColJob::finished),
         this, &FolderWizardRemotePath::slotCreateRemoteFolderFinished);
@@ -405,7 +405,7 @@ void FolderWizardRemotePath::slotTypedPathError(QNetworkReply *reply)
 
 LsColJob *FolderWizardRemotePath::runLsColJob(const QString &path)
 {
-    LsColJob *job = new LsColJob(_account, path, this);
+    auto *job = new LsColJob(_account, path, this);
     job->setProperties(QList<QByteArray>() << "resourcetype");
     connect(job, &LsColJob::directoryListingSubfolders,
         this, &FolderWizardRemotePath::slotUpdateDirectories);
@@ -435,7 +435,7 @@ bool FolderWizardRemotePath::isComplete() const
     Folder::Map map = FolderMan::instance()->map();
     Folder::Map::const_iterator i = map.constBegin();
     for (i = map.constBegin(); i != map.constEnd(); i++) {
-        Folder *f = static_cast<Folder *>(i.value());
+        auto *f = static_cast<Folder *>(i.value());
         if (f->accountState()->account() != _account) {
             continue;
         }
@@ -480,7 +480,7 @@ void FolderWizardRemotePath::showWarn(const QString &msg) const
 
 FolderWizardSelectiveSync::FolderWizardSelectiveSync(const AccountPtr &account)
 {
-    QVBoxLayout *layout = new QVBoxLayout(this);
+    auto *layout = new QVBoxLayout(this);
     _selectiveSync = new SelectiveSyncWidget(account, this);
     layout->addWidget(_selectiveSync);
 }
index 67c8ab4f2f2a0318ee7d63955bb2ebc4a571c3d2..7eaab489204b35bc68a323761e3314117af087cf 100644 (file)
@@ -144,11 +144,11 @@ int IgnoreListTableWidget::addPattern(const QString &pattern, bool deletable, bo
     int newRow = ui->tableWidget->rowCount();
     ui->tableWidget->setRowCount(newRow + 1);
 
-    QTableWidgetItem *patternItem = new QTableWidgetItem;
+    auto *patternItem = new QTableWidgetItem;
     patternItem->setText(pattern);
     ui->tableWidget->setItem(newRow, patternCol, patternItem);
 
-    QTableWidgetItem *deletableItem = new QTableWidgetItem;
+    auto *deletableItem = new QTableWidgetItem;
     deletableItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
     deletableItem->setCheckState(deletable ? Qt::Checked : Qt::Unchecked);
     ui->tableWidget->setItem(newRow, deletableCol, deletableItem);
index 7abfeb22dddc0a5d2c386b2af0c65f58f8807ad1..691ed2373a98ec10fdb889ddddd18b659575ee32 100644 (file)
@@ -58,23 +58,23 @@ LogBrowser::LogBrowser(QWidget *parent)
     setWindowTitle(tr("Log Output"));
     setMinimumWidth(600);
 
-    QVBoxLayout *mainLayout = new QVBoxLayout;
+    auto *mainLayout = new QVBoxLayout;
     // mainLayout->setMargin(0);
 
     mainLayout->addWidget(_logWidget);
 
-    QHBoxLayout *toolLayout = new QHBoxLayout;
+    auto *toolLayout = new QHBoxLayout;
     mainLayout->addLayout(toolLayout);
 
     // Search input field
-    QLabel *lab = new QLabel(tr("&Search:") + " ");
+    auto *lab = new QLabel(tr("&Search:") + " ");
     _findTermEdit = new QLineEdit;
     lab->setBuddy(_findTermEdit);
     toolLayout->addWidget(lab);
     toolLayout->addWidget(_findTermEdit);
 
     // find button
-    QPushButton *findBtn = new QPushButton;
+    auto *findBtn = new QPushButton;
     findBtn->setText(tr("&Find"));
     connect(findBtn, &QAbstractButton::clicked, this, &LogBrowser::slotFind);
     toolLayout->addWidget(findBtn);
@@ -90,7 +90,7 @@ LogBrowser::LogBrowser(QWidget *parent)
     connect(_logDebugCheckBox, &QCheckBox::stateChanged, this, &LogBrowser::slotDebugCheckStateChanged);
     toolLayout->addWidget(_logDebugCheckBox);
 
-    QDialogButtonBox *btnbox = new QDialogButtonBox;
+    auto *btnbox = new QDialogButtonBox;
     QPushButton *closeBtn = btnbox->addButton(QDialogButtonBox::Close);
     connect(closeBtn, &QAbstractButton::clicked, this, &QWidget::close);
 
@@ -132,7 +132,7 @@ LogBrowser::LogBrowser(QWidget *parent)
     // Direct connection for log coming from this thread, and queued for the one in a different thread
     connect(Logger::instance(), &Logger::logWindowLog, this, &LogBrowser::slotNewLog, Qt::AutoConnection);
 
-    QAction *showLogWindow = new QAction(this);
+    auto *showLogWindow = new QAction(this);
     showLogWindow->setShortcut(QKeySequence("F12"));
     connect(showLogWindow, &QAction::triggered, this, &QWidget::close);
     addAction(showLogWindow);
index 11e2deffe7f3c15d53dd5010e2a5dee465e0e10e..ab4038c05c9bf6e095f9332cfe55ab0f18551f44 100644 (file)
@@ -77,7 +77,7 @@ void OcsJob::start()
     addRawHeader("Ocs-APIREQUEST", "true");
     addRawHeader("Content-Type", "application/x-www-form-urlencoded");
 
-    QBuffer *buffer = new QBuffer;
+    auto *buffer = new QBuffer;
 
     QUrlQuery queryItems;
     if (_verb == "GET") {
index d271059ab01861f27cca1eaa7db2d147ffc9ae88..5d6cb41603c83deba91434193880775d34660295 100644 (file)
@@ -443,7 +443,7 @@ void ownCloudGui::slotUpdateProgress(const QString &folder, const ProgressInfo &
         QString kindStr = Progress::asResultString(progress._lastCompletedItem);
         QString timeStr = QTime::currentTime().toString("hh:mm");
         QString actionText = tr("%1 (%2, %3)").arg(progress._lastCompletedItem._file, kindStr, timeStr);
-        QAction *action = new QAction(actionText, this);
+        auto *action = new QAction(actionText, this);
         Folder *f = FolderMan::instance()->folder(folder);
         if (f) {
             QString fullPath = f->path() + '/' + progress._lastCompletedItem._file;
@@ -523,7 +523,7 @@ void ownCloudGui::setPauseOnAllFoldersHelper(bool pause)
 
 void ownCloudGui::slotShowGuiMessage(const QString &title, const QString &message)
 {
-    QMessageBox *msgBox = new QMessageBox;
+    auto *msgBox = new QMessageBox;
     msgBox->setWindowFlags(msgBox->windowFlags() | Qt::WindowStaysOnTopHint);
     msgBox->setAttribute(Qt::WA_DeleteOnClose);
     msgBox->setText(message);
index 00037378101da3e443b59405878b3b70b083f493..38f0f1980878edbe5b5b3a62968a2f1f4997a1f9 100644 (file)
@@ -195,7 +195,7 @@ void OwncloudSetupWizard::slotFindServer()
     // 3. Check redirected-url/status.php with CheckServerJob
 
     // Step 1: Check url/status.php
-    CheckServerJob *job = new CheckServerJob(account, this);
+    auto *job = new CheckServerJob(account, this);
     job->setIgnoreCredentialFailure(true);
     connect(job, &CheckServerJob::instanceFound, this, &OwncloudSetupWizard::slotFoundServer);
     connect(job, &CheckServerJob::instanceNotFound, this, &OwncloudSetupWizard::slotFindServerBehindRedirect);
@@ -233,7 +233,7 @@ void OwncloudSetupWizard::slotFindServerBehindRedirect()
     // Step 3: When done, start checking status.php.
     connect(redirectCheckJob, &SimpleNetworkJob::finishedSignal, this,
         [this, account]() {
-            CheckServerJob *job = new CheckServerJob(account, this);
+            auto *job = new CheckServerJob(account, this);
             job->setIgnoreCredentialFailure(true);
             connect(job, &CheckServerJob::instanceFound, this, &OwncloudSetupWizard::slotFoundServer);
             connect(job, &CheckServerJob::instanceNotFound, this, &OwncloudSetupWizard::slotNoServerFound);
@@ -319,7 +319,7 @@ void OwncloudSetupWizard::slotNoServerFoundTimeout(const QUrl &url)
 
 void OwncloudSetupWizard::slotDetermineAuthType()
 {
-    DetermineAuthTypeJob *job = new DetermineAuthTypeJob(_ocWizard->account(), this);
+    auto *job = new DetermineAuthTypeJob(_ocWizard->account(), this);
     connect(job, &DetermineAuthTypeJob::authType,
         _ocWizard, &OwncloudWizard::setAuthType);
     job->start();
@@ -357,7 +357,7 @@ void OwncloudSetupWizard::slotAuthError()
 {
     QString errorMsg;
 
-    PropfindJob *job = qobject_cast<PropfindJob *>(sender());
+    auto *job = qobject_cast<PropfindJob *>(sender());
     if (!job) {
         qCWarning(lcWizard) << "Can't check for authed redirects. This slot should be invoked from PropfindJob!";
         return;
@@ -501,7 +501,7 @@ void OwncloudSetupWizard::slotCreateLocalAndRemoteFolders(const QString &localFo
          * END - Sanitize URL paths to eliminate double-slashes
         */
 
-        EntityExistsJob *job = new EntityExistsJob(_ocWizard->account(), newUrlPath, this);
+        auto *job = new EntityExistsJob(_ocWizard->account(), newUrlPath, this);
         connect(job, &EntityExistsJob::exists, this, &OwncloudSetupWizard::slotRemoteFolderExists);
         job->start();
     } else {
@@ -542,7 +542,7 @@ void OwncloudSetupWizard::createRemoteFolder()
 {
     _ocWizard->appendToConfigurationLog(tr("creating folder on Nextcloud: %1").arg(_remoteFolder));
 
-    MkColJob *job = new MkColJob(_ocWizard->account(), _remoteFolder, this);
+    auto *job = new MkColJob(_ocWizard->account(), _remoteFolder, this);
     connect(job, SIGNAL(finished(QNetworkReply::NetworkError)), SLOT(slotCreateRemoteFolderFinished(QNetworkReply::NetworkError)));
     job->start();
 }
index 8fae8ee34109a702723a35da8d4e5c704311622c..a75412f13279bfe3f84cd1c06689fbf6913f4552 100644 (file)
@@ -85,7 +85,7 @@ void ProxyAuthHandler::handleProxyAuthenticationRequired(
     // Find the responsible QNAM if possible.
     QNetworkAccessManager *sending_qnam = nullptr;
     QWeakPointer<QNetworkAccessManager> qnam_alive;
-    if (Account *account = qobject_cast<Account *>(sender())) {
+    if (auto *account = qobject_cast<Account *>(sender())) {
         // Since we go into an event loop, it's possible for the account's qnam
         // to be destroyed before we get back. We can use this to check for its
         // liveness.
@@ -236,7 +236,7 @@ void ProxyAuthHandler::storeCredsInKeychain()
 
     _settings->setValue(keychainUsernameKey(), _username);
 
-    WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName(), this);
+    auto *job = new WritePasswordJob(Theme::instance()->appName(), this);
     job->setSettings(_settings.data());
     job->setInsecureFallback(false);
     job->setKey(keychainPasswordKey());
index 485880db47ec6a8c060d26d55bbdc3100cbaae90..8ee353fbe9d432108852deb5f05acb2e29779c32 100644 (file)
@@ -106,7 +106,7 @@ QSize SelectiveSyncWidget::sizeHint() const
 
 void SelectiveSyncWidget::refreshFolders()
 {
-    LsColJob *job = new LsColJob(_account, _folderPath, this);
+    auto *job = new LsColJob(_account, _folderPath, this);
     job->setProperties(QList<QByteArray>() << "resourcetype"
                                            << "http://owncloud.org/ns:size");
     connect(job, &LsColJob::directoryListingSubfolders,
@@ -153,7 +153,7 @@ void SelectiveSyncWidget::recursiveInsert(QTreeWidgetItem *parent, QStringList p
         parent->setToolTip(0, path);
         parent->setData(0, Qt::UserRole, path);
     } else {
-        SelectiveSyncTreeViewItem *item = static_cast<SelectiveSyncTreeViewItem *>(findFirstChild(parent, pathTrail.first()));
+        auto *item = static_cast<SelectiveSyncTreeViewItem *>(findFirstChild(parent, pathTrail.first()));
         if (!item) {
             item = new SelectiveSyncTreeViewItem(parent);
             if (parent->checkState(0) == Qt::Checked
@@ -191,7 +191,7 @@ void SelectiveSyncWidget::slotUpdateDirectories(QStringList list)
     QScopedValueRollback<bool> isInserting(_inserting);
     _inserting = true;
 
-    SelectiveSyncTreeViewItem *root = static_cast<SelectiveSyncTreeViewItem *>(_folderTree->topLevelItem(0));
+    auto *root = static_cast<SelectiveSyncTreeViewItem *>(_folderTree->topLevelItem(0));
 
     QUrl url = _account->davUrl();
     QString pathToRemove = url.path();
@@ -290,7 +290,7 @@ void SelectiveSyncWidget::slotItemExpanded(QTreeWidgetItem *item)
     if (!_folderPath.isEmpty()) {
         prefix = _folderPath + QLatin1Char('/');
     }
-    LsColJob *job = new LsColJob(_account, prefix + dir, this);
+    auto *job = new LsColJob(_account, prefix + dir, this);
     job->setProperties(QList<QByteArray>() << "resourcetype"
                                            << "http://owncloud.org/ns:size");
     connect(job, &LsColJob::directoryListingSubfolders,
@@ -457,10 +457,10 @@ SelectiveSyncDialog::SelectiveSyncDialog(AccountPtr account, const QString &fold
 void SelectiveSyncDialog::init(const AccountPtr &account)
 {
     setWindowTitle(tr("Choose What to Sync"));
-    QVBoxLayout *layout = new QVBoxLayout(this);
+    auto *layout = new QVBoxLayout(this);
     _selectiveSync = new SelectiveSyncWidget(account, this);
     layout->addWidget(_selectiveSync);
-    QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Horizontal);
+    auto *buttonBox = new QDialogButtonBox(Qt::Horizontal);
     _okButton = buttonBox->addButton(QDialogButtonBox::Ok);
     connect(_okButton, &QPushButton::clicked, this, &SelectiveSyncDialog::accept);
     QPushButton *button;
index 206e4d44421cdb9a7294757e4124dac1329b85bf..1815b72cb19dc33b10a7d2a645c85995255e762c 100644 (file)
@@ -70,7 +70,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
     layout()->setMenuBar(_toolBar);
 
     // People perceive this as a Window, so also make Ctrl+W work
-    QAction *closeWindowAction = new QAction(this);
+    auto *closeWindowAction = new QAction(this);
     closeWindowAction->setShortcut(QKeySequence("Ctrl+W"));
     connect(closeWindowAction, &QAction::triggered, this, &SettingsDialog::accept);
     addAction(closeWindowAction);
@@ -92,7 +92,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
     _toolBar->addAction(_actionBefore);
 
     // Adds space between users + activities and general + network actions
-    QWidget* spacer = new QWidget();
+    auto* spacer = new QWidget();
     spacer->setMinimumWidth(10);
     spacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
     _toolBar->addWidget(spacer);
@@ -100,7 +100,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
     QAction *generalAction = createColorAwareAction(QLatin1String(":/client/theme/settings.svg"), tr("General"));
     _actionGroup->addAction(generalAction);
     _toolBar->addAction(generalAction);
-    GeneralSettings *generalSettings = new GeneralSettings;
+    auto *generalSettings = new GeneralSettings;
     _ui->stack->addWidget(generalSettings);
 
     // Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
@@ -109,7 +109,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
     QAction *networkAction = createColorAwareAction(QLatin1String(":/client/theme/network.svg"), tr("Network"));
     _actionGroup->addAction(networkAction);
     _toolBar->addAction(networkAction);
-    NetworkSettings *networkSettings = new NetworkSettings;
+    auto *networkSettings = new NetworkSettings;
     _ui->stack->addWidget(networkSettings);
 
     _actionGroupWidgets.insert(generalAction, generalSettings);
@@ -121,7 +121,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
 
     QTimer::singleShot(1, this, &SettingsDialog::showFirstPage);
 
-    QAction *showLogWindow = new QAction(this);
+    auto *showLogWindow = new QAction(this);
     showLogWindow->setShortcut(QKeySequence("F12"));
     connect(showLogWindow, &QAction::triggered, gui, &ownCloudGui::slotToggleLogBrowser);
     addAction(showLogWindow);
@@ -238,7 +238,7 @@ void SettingsDialog::accountAdded(AccountState *s)
 
 void SettingsDialog::slotAccountAvatarChanged()
 {
-    Account *account = static_cast<Account *>(sender());
+    auto *account = static_cast<Account *>(sender());
     if (account && _actionForAccount.contains(account)) {
         QAction *action = _actionForAccount[account];
         if (action) {
@@ -252,7 +252,7 @@ void SettingsDialog::slotAccountAvatarChanged()
 
 void SettingsDialog::slotAccountDisplayNameChanged()
 {
-    Account *account = static_cast<Account *>(sender());
+    auto *account = static_cast<Account *>(sender());
     if (account && _actionForAccount.contains(account)) {
         QAction *action = _actionForAccount[account];
         if (action) {
@@ -308,7 +308,7 @@ void SettingsDialog::customizeStyle()
     Q_FOREACH (QAction *a, _actionGroup->actions()) {
         QIcon icon = Theme::createColorAwareIcon(a->property("iconPath").toString(), palette());
         a->setIcon(icon);
-        QToolButton *btn = qobject_cast<QToolButton *>(_toolBar->widgetForAction(a));
+        auto *btn = qobject_cast<QToolButton *>(_toolBar->widgetForAction(a));
         if (btn)
             btn->setIcon(icon);
     }
@@ -333,7 +333,7 @@ public:
             return nullptr;
         }
 
-        QToolButton *btn = new QToolButton(parent);
+        auto *btn = new QToolButton(parent);
         btn->setDefaultAction(this);
         btn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
         btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
index 9609a270ca9525e9b90e28c64c10db087022d373..91081e057e9cff6e6a17c4075b60f6f85d14a6f5 100644 (file)
@@ -109,7 +109,7 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
     }
 
     if (QFileInfo(_localPath).isFile()) {
-        ThumbnailJob *job = new ThumbnailJob(_sharePath, _accountState->account(), this);
+        auto *job = new ThumbnailJob(_sharePath, _accountState->account(), this);
         connect(job, &ThumbnailJob::jobFinished, this, &ShareDialog::slotThumbnailFetched);
         job->start();
     }
index 035a51411882ab5ee1bedfded699357f1152f356..aab3d00bfc1025ffd2f0899d38cf6d24a287c57f 100644 (file)
@@ -73,7 +73,7 @@ void ShareeModel::fetch(const QString &search, const ShareeSet &blacklist)
 {
     _search = search;
     _shareeBlacklist = blacklist;
-    OcsShareeJob *job = new OcsShareeJob(_account);
+    auto *job = new OcsShareeJob(_account);
     connect(job, &OcsShareeJob::shareeJobFinished, this, &ShareeModel::shareesFetched);
     connect(job, &OcsJob::ocsError, this, &ShareeModel::displayErrorMessage);
     job->getSharees(_search, _type, 1, 50);
index fb557ba41f7442a5002678801231f414567ed473..12f2e702759a977151f9bb0d0b1be0eaa8805dc7 100644 (file)
@@ -145,7 +145,7 @@ void ShareLinkWidget::setupUiOptions()
     const QDate expireDate = _linkShare.data()->getExpireDate().isValid() ? _linkShare.data()->getExpireDate() : QDate();
     const SharePermissions perm = _linkShare.data()->getPermissions();
     bool checked = false;
-    QActionGroup *permissionsGroup = new QActionGroup(this);
+    auto *permissionsGroup = new QActionGroup(this);
 
     // Prepare sharing menu
     _linkContextMenu = new QMenu(this);
@@ -335,7 +335,7 @@ void ShareLinkWidget::slotPasswordSet()
 
 void ShareLinkWidget::startAnimation(const int start, const int end)
 {
-    QPropertyAnimation *animation = new QPropertyAnimation(this, "maximumHeight", this);
+    auto *animation = new QPropertyAnimation(this, "maximumHeight", this);
 
     animation->setDuration(500);
     animation->setStartValue(start);
index ca14c9b42164e3a03064fa2335a8598475ba45e9..2b8fbd4a98c5991f951900d62967eaba872f57bd 100644 (file)
@@ -106,7 +106,7 @@ QSharedPointer<Sharee> Share::getShareWith() const
 
 void Share::setPermissions(Permissions permissions)
 {
-    OcsShareJob *job = new OcsShareJob(_account);
+    auto *job = new OcsShareJob(_account);
     connect(job, &OcsShareJob::shareJobFinished, this, &Share::slotPermissionsSet);
     connect(job, &OcsJob::ocsError, this, &Share::slotOcsError);
     job->setPermissions(getId(), permissions);
@@ -125,7 +125,7 @@ Share::Permissions Share::getPermissions() const
 
 void Share::deleteShare()
 {
-    OcsShareJob *job = new OcsShareJob(_account);
+    auto *job = new OcsShareJob(_account);
     connect(job, &OcsShareJob::shareJobFinished, this, &Share::slotDeleted);
     connect(job, &OcsJob::ocsError, this, &Share::slotOcsError);
     job->deleteShare(getId());
@@ -207,7 +207,7 @@ QString LinkShare::getNote() const
 
 void LinkShare::setName(const QString &name)
 {
-    OcsShareJob *job = new OcsShareJob(_account);
+    auto *job = new OcsShareJob(_account);
     connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotNameSet);
     connect(job, &OcsJob::ocsError, this, &LinkShare::slotOcsError);
     job->setName(getId(), name);
@@ -215,7 +215,7 @@ void LinkShare::setName(const QString &name)
 
 void LinkShare::setNote(const QString &note)
 {
-    OcsShareJob *job = new OcsShareJob(_account);
+    auto *job = new OcsShareJob(_account);
     connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotNoteSet);
     connect(job, &OcsJob::ocsError, this, &LinkShare::slotOcsError);
     job->setNote(getId(), note);
@@ -234,7 +234,7 @@ QString LinkShare::getToken() const
 
 void LinkShare::setPassword(const QString &password)
 {
-    OcsShareJob *job = new OcsShareJob(_account);
+    auto *job = new OcsShareJob(_account);
     connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotPasswordSet);
     connect(job, &OcsJob::ocsError, this, &LinkShare::slotSetPasswordError);
     job->setPassword(getId(), password);
@@ -248,7 +248,7 @@ void LinkShare::slotPasswordSet(const QJsonDocument &, const QVariant &value)
 
 void LinkShare::setExpireDate(const QDate &date)
 {
-    OcsShareJob *job = new OcsShareJob(_account);
+    auto *job = new OcsShareJob(_account);
     connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotExpireDateSet);
     connect(job, &OcsJob::ocsError, this, &LinkShare::slotOcsError);
     job->setExpireDate(getId(), date);
@@ -291,7 +291,7 @@ void ShareManager::createLinkShare(const QString &path,
     const QString &name,
     const QString &password)
 {
-    OcsShareJob *job = new OcsShareJob(_account);
+    auto *job = new OcsShareJob(_account);
     connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotLinkShareCreated);
     connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
     job->createLinkShare(path, name, password);
@@ -348,7 +348,7 @@ void ShareManager::createShare(const QString &path,
                 validPermissions &= existingPermissions;
             }
 
-            OcsShareJob *job = new OcsShareJob(_account);
+            auto *job = new OcsShareJob(_account);
             connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotShareCreated);
             connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
             job->createShare(path, shareType, shareWith, validPermissions);
@@ -370,7 +370,7 @@ void ShareManager::slotShareCreated(const QJsonDocument &reply)
 
 void ShareManager::fetchShares(const QString &path)
 {
-    OcsShareJob *job = new OcsShareJob(_account);
+    auto *job = new OcsShareJob(_account);
     connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotSharesFetched);
     connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
     job->getShares(path);
index 0a2bea6ab8217dd91a2ef24baf4f5087cfc70198..41dc21808902100ba49ff795ab67c514a4fceea1 100644 (file)
@@ -213,7 +213,7 @@ void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>>
             _ui->mainOwnerLabel->setText(QString("Shared with you by ").append(share->getOwnerDisplayName()));
         }
 
-        ShareUserLine *s = new ShareUserLine(share, _maxSharingPermissions, _isFile, _parentScrollArea);
+        auto *s = new ShareUserLine(share, _maxSharingPermissions, _isFile, _parentScrollArea);
         connect(s, &ShareUserLine::resizeRequested, this, &ShareUserGroupWidget::slotAdjustScrollWidgetSize);
         connect(s, &ShareUserLine::visualDeletionDone, this, &ShareUserGroupWidget::getShares);
         s->setBackgroundRole(layout->count() % 2 == 0 ? QPalette::Base : QPalette::AlternateBase);
@@ -411,7 +411,7 @@ ShareUserLine::ShareUserLine(QSharedPointer<Share> share,
     connect(_ui->permissionsEdit, &QAbstractButton::clicked, this, &ShareUserLine::slotEditPermissionsChanged);
 
     // create menu with checkable permissions
-    QMenu *menu = new QMenu(this);
+    auto *menu = new QMenu(this);
     _permissionReshare= new QAction(tr("Can reshare"), this);
     _permissionReshare->setCheckable(true);
     _permissionReshare->setEnabled(maxSharingPermissions & SharePermissionShare);
@@ -518,7 +518,7 @@ void ShareUserLine::loadAvatar()
      * Currently only regular users can have avatars.
      */
     if (_share->getShareWith()->type() == Sharee::User) {
-        AvatarJob *job = new AvatarJob(_share->account(), _share->getShareWith()->shareWith(), avatarSize, this);
+        auto *job = new AvatarJob(_share->account(), _share->getShareWith()->shareWith(), avatarSize, this);
         connect(job, &AvatarJob::avatarPixmap, this, &ShareUserLine::slotAvatarLoaded);
         job->start();
     }
@@ -623,7 +623,7 @@ void ShareUserLine::slotDeleteAnimationFinished()
 
 void ShareUserLine::slotShareDeleted()
 {
-    QPropertyAnimation *animation = new QPropertyAnimation(this, "maximumHeight", this);
+    auto *animation = new QPropertyAnimation(this, "maximumHeight", this);
 
     animation->setDuration(500);
     animation->setStartValue(height());
index 43bd6336389090614f917939f26ceabb86fd50fa..a3474c783d718605e68c390422216e8309145a6e 100644 (file)
@@ -271,13 +271,13 @@ void SocketApi::onLostConnection()
 
 void SocketApi::slotSocketDestroyed(QObject *obj)
 {
-    QIODevice *socket = static_cast<QIODevice *>(obj);
+    auto *socket = static_cast<QIODevice *>(obj);
     _listeners.erase(std::remove_if(_listeners.begin(), _listeners.end(), ListenerHasSocketPred(socket)), _listeners.end());
 }
 
 void SocketApi::slotReadSocket()
 {
-    QIODevice *socket = qobject_cast<QIODevice *>(sender());
+    auto *socket = qobject_cast<QIODevice *>(sender());
     ASSERT(socket);
     SocketListener *listener = &*std::find_if(_listeners.begin(), _listeners.end(), ListenerHasSocketPred(socket));
 
@@ -482,7 +482,7 @@ void SocketApi::command_EDIT(const QString &localFile, SocketListener *listener)
     if (!editor)
         return;
 
-    JsonApiJob *job = new JsonApiJob(fileData.folder->accountState()->account(), QLatin1String("ocs/v2.php/apps/files/api/v1/directEditing/open"), this);
+    auto *job = new JsonApiJob(fileData.folder->accountState()->account(), QLatin1String("ocs/v2.php/apps/files/api/v1/directEditing/open"), this);
 
     QUrlQuery params;
     params.addQueryItem("path", fileData.accountRelativePath);
index 8b4bd6e4085aa53a1d96fb13da30749adcfa9815..a2c56e5ef7232a7de7a61fdf8140ccc16c33082e 100644 (file)
@@ -141,16 +141,16 @@ QMenu *SslButton::buildCertMenu(QMenu *parent, const QSslCertificate &cert,
     }
 
     // create label first
-    QLabel *label = new QLabel(parent);
+    auto *label = new QLabel(parent);
     label->setStyleSheet(QLatin1String("QLabel { padding: 8px; }"));
     label->setTextFormat(Qt::RichText);
     label->setText(details);
 
     // plug label into widget action
-    QWidgetAction *action = new QWidgetAction(parent);
+    auto *action = new QWidgetAction(parent);
     action->setDefaultWidget(label);
     // plug action into menu
-    QMenu *menu = new QMenu(parent);
+    auto *menu = new QMenu(parent);
     menu->menuAction()->setText(txt);
     menu->addAction(action);
 
index 814a7b0af0aef90701f933ee1e391d077027f545..5c148dc85881964cc796a3d56c0e0187919e002e 100644 (file)
@@ -148,7 +148,7 @@ bool SslErrorDialog::checkFailingCertsKnown(const QList<QSslError> &errors)
     }
     msg += QL("</div></body></html>");
 
-    QTextDocument *doc = new QTextDocument(nullptr);
+    auto *doc = new QTextDocument(nullptr);
     QString style = styleSheet();
     doc->addResource(QTextDocument::StyleSheetResource, QUrl(QL("format.css")), style);
     doc->setHtml(msg);
index 205dfc64fb377e17285cc85d41bf21c47789ec75..5b4233a0114bfc384d22e61bd1937a5e3e54a8cd 100644 (file)
@@ -32,7 +32,7 @@ ToolTipUpdater::ToolTipUpdater(QTreeView *treeView)
 bool ToolTipUpdater::eventFilter(QObject * /*obj*/, QEvent *ev)
 {
     if (ev->type() == QEvent::ToolTip) {
-        QHelpEvent *helpEvent = static_cast<QHelpEvent *>(ev);
+        auto *helpEvent = static_cast<QHelpEvent *>(ev);
         _toolTipPos = helpEvent->globalPos();
     }
     return false;
index 1562b77a622772d35c5bfb6470a794ef91fb2c3c..a5ec6f034942f83070bbcd35dafc3e51cf8d35cf 100644 (file)
@@ -221,7 +221,7 @@ void ActivityListModel::startFetchJob()
     if (!_accountState->isConnected()) {
         return;
     }
-    JsonApiJob *job = new JsonApiJob(_accountState->account(), QLatin1String("ocs/v2.php/apps/activity/api/v2/activity"), this);
+    auto *job = new JsonApiJob(_accountState->account(), QLatin1String("ocs/v2.php/apps/activity/api/v2/activity"), this);
     QObject::connect(job, &JsonApiJob::jsonReceived,
         this, &ActivityListModel::slotActivitiesReceived);
 
@@ -271,7 +271,7 @@ void ActivityListModel::slotActivitiesReceived(const QJsonDocument &json, int st
         a._icon = json.value("icon").toString();
 
         if (!a._icon.isEmpty()) {
-            IconJob *iconJob = new IconJob(QUrl(a._icon));
+            auto *iconJob = new IconJob(QUrl(a._icon));
             iconJob->setProperty("activityId", a._id);
             connect(iconJob, &IconJob::jobFinished, this, &ActivityListModel::slotIconDownloaded);
         }
index 4571f9a9dfe138404b70f43294e1ff39d030d412..70401b21f113c08801a1199f4e6acd9e87d8593e 100644 (file)
@@ -57,7 +57,7 @@ void ServerNotificationHandler::slotEtagResponseHeaderReceived(const QByteArray
 {
     if (statusCode == successStatusCode) {
         qCWarning(lcServerNotification) << "New Notification ETag Response Header received " << value;
-        AccountState *account = qvariant_cast<AccountState *>(sender()->property(propertyAccountStateC));
+        auto *account = qvariant_cast<AccountState *>(sender()->property(propertyAccountStateC));
         account->setNotificationsEtagResponseHeader(value);
     }
 }
@@ -83,7 +83,7 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j
 
     auto notifies = json.object().value("ocs").toObject().value("data").toArray();
 
-    AccountState *ai = qvariant_cast<AccountState *>(sender()->property(propertyAccountStateC));
+    auto *ai = qvariant_cast<AccountState *>(sender()->property(propertyAccountStateC));
 
     ActivityList list;
 
@@ -103,7 +103,7 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j
         a._icon = json.value("icon").toString();
 
         if (!a._icon.isEmpty()) {
-            IconJob *iconJob = new IconJob(QUrl(a._icon));
+            auto *iconJob = new IconJob(QUrl(a._icon));
             iconJob->setProperty("activityId", a._id);
             connect(iconJob, &IconJob::jobFinished, this, &ServerNotificationHandler::slotIconDownloaded);
         }
index be6b51dbf82838546ced800ecae7b3c70b510c3a..6938e4c5b1bbd8c508647c568b7629eb00a26c9b 100644 (file)
@@ -137,7 +137,7 @@ void User::slotRefreshNotifications()
     // start a server notification handler if no notification requests
     // are running
     if (_notificationRequestsRunning == 0) {
-        ServerNotificationHandler *snh = new ServerNotificationHandler(_account.data());
+        auto *snh = new ServerNotificationHandler(_account.data());
         connect(snh, &ServerNotificationHandler::newNotificationList,
             this, &User::slotBuildNotificationDisplay);
 
@@ -185,7 +185,7 @@ void User::slotSendNotificationRequest(const QString &accountName, const QString
     if (validVerbs.contains(verb)) {
         AccountStatePtr acc = AccountManager::instance()->account(accountName);
         if (acc) {
-            NotificationConfirmJob *job = new NotificationConfirmJob(acc->account());
+            auto *job = new NotificationConfirmJob(acc->account());
             QUrl l(link);
             job->setLinkAndVerb(l, verb);
             job->setProperty("activityRow", QVariant::fromValue(row));
@@ -206,7 +206,7 @@ void User::slotSendNotificationRequest(const QString &accountName, const QString
 
 void User::slotNotifyNetworkError(QNetworkReply *reply)
 {
-    NotificationConfirmJob *job = qobject_cast<NotificationConfirmJob *>(sender());
+    auto *job = qobject_cast<NotificationConfirmJob *>(sender());
     if (!job) {
         return;
     }
@@ -219,7 +219,7 @@ void User::slotNotifyNetworkError(QNetworkReply *reply)
 
 void User::slotNotifyServerFinished(const QString &reply, int replyCode)
 {
-    NotificationConfirmJob *job = qobject_cast<NotificationConfirmJob *>(sender());
+    auto *job = qobject_cast<NotificationConfirmJob *>(sender());
     if (!job) {
         return;
     }
index 4f1446edfaac2c596906b28a09a9b4be871ad24a..c7916c516d7dff22615ba4b7fa3ce36acc1871da 100644 (file)
@@ -137,7 +137,7 @@ void UserInfo::slotUpdateLastInfo(const QJsonDocument &json)
 
     // Avatar Image
     if(_fetchAvatarImage) {
-        AvatarJob *job = new AvatarJob(account, account->davUser(), 128, this);
+        auto *job = new AvatarJob(account, account->davUser(), 128, this);
         job->setTimeout(20 * 1000);
         QObject::connect(job, &AvatarJob::avatarPixmap, this, &UserInfo::slotAvatarImage);
         job->start();
index d04d9741e0ccfcb028c0afc62469b625c30a5203..f0c63f6c86982b9a939bb01c5fb0f077c0691934 100644 (file)
@@ -51,7 +51,7 @@ Flow2AuthCredsPage::Flow2AuthCredsPage()
 
 void Flow2AuthCredsPage::initializePage()
 {
-    OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+    auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
     Q_ASSERT(ocWizard);
     ocWizard->account()->setCredentials(CredentialsFactory::create("http"));
 
@@ -94,7 +94,7 @@ void Flow2AuthCredsPage::slotFlow2AuthResult(Flow2Auth::Result r, const QString
     case Flow2Auth::LoggedIn: {
         _user = user;
         _appPassword = appPassword;
-        OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+        auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
         Q_ASSERT(ocWizard);
 
         emit connectToOCUrl(ocWizard->account()->url().toString());
@@ -110,7 +110,7 @@ int Flow2AuthCredsPage::nextId() const
 
 void Flow2AuthCredsPage::setConnected()
 {
-    OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+    auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
     Q_ASSERT(ocWizard);
 
     // bring wizard to top
@@ -119,7 +119,7 @@ void Flow2AuthCredsPage::setConnected()
 
 AbstractCredentials *Flow2AuthCredsPage::getCredentials() const
 {
-    OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+    auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
     Q_ASSERT(ocWizard);
     return new WebFlowCredentials(
                 _user,
index f83e1f43f8cd960819ddf7d4b24e56ff1fa46c8c..ce15dc105bfa559117f88e0e722eebcb50fd4e46 100644 (file)
@@ -316,7 +316,7 @@ void OwncloudAdvancedSetupPage::slotSelectiveSyncClicked()
     _ui.rSyncEverything->setChecked(_selectiveSyncBlacklist.isEmpty());
 
     AccountPtr acc = static_cast<OwncloudWizard *>(wizard())->account();
-    SelectiveSyncDialog *dlg = new SelectiveSyncDialog(acc, _remoteFolder, _selectiveSyncBlacklist, this);
+    auto *dlg = new SelectiveSyncDialog(acc, _remoteFolder, _selectiveSyncBlacklist, this);
 
     const int result = dlg->exec();
     bool updateBlacklist = false;
index 092bf789dcc3826646f6834f09f38275bff8afe1..02a82c45910ed168286466609c9e07a466526379 100644 (file)
@@ -84,9 +84,9 @@ void OwncloudHttpCredsPage::initializePage()
 {
     WizardCommon::initErrorLabel(_ui.errorLabel);
 
-    OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+    auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
     AbstractCredentials *cred = ocWizard->account()->credentials();
-    HttpCredentials *httpCreds = qobject_cast<HttpCredentials *>(cred);
+    auto *httpCreds = qobject_cast<HttpCredentials *>(cred);
     if (httpCreds) {
         const QString user = httpCreds->fetchUser();
         if (!user.isEmpty()) {
@@ -134,7 +134,7 @@ bool OwncloudHttpCredsPage::validatePage()
         startSpinner();
 
         // Reset cookies to ensure the username / password is actually used
-        OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+        auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
         ocWizard->account()->clearCookieJar();
 
         emit completeChanged();
index 0d4c40ea7ea4426f12ebf984c7940b1d1acc7b22..9ed5da0d345f7f5153feda0452472d65a36a8701 100644 (file)
@@ -51,7 +51,7 @@ OwncloudOAuthCredsPage::OwncloudOAuthCredsPage()
 
 void OwncloudOAuthCredsPage::initializePage()
 {
-    OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+    auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
     Q_ASSERT(ocWizard);
     ocWizard->account()->setCredentials(CredentialsFactory::create("http"));
     _asyncAuth.reset(new OAuth(ocWizard->account().data(), this));
@@ -75,7 +75,7 @@ void OwncloudOAuthCredsPage::asyncAuthResult(OAuth::Result r, const QString &use
     switch (r) {
     case OAuth::NotSupported: {
         /* OAuth not supported (can't open browser), fallback to HTTP credentials */
-        OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+        auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
         ocWizard->back();
         ocWizard->setAuthType(DetermineAuthTypeJob::Basic);
         break;
@@ -89,7 +89,7 @@ void OwncloudOAuthCredsPage::asyncAuthResult(OAuth::Result r, const QString &use
         _token = token;
         _user = user;
         _refreshToken = refreshToken;
-        OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+        auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
         Q_ASSERT(ocWizard);
         emit connectToOCUrl(ocWizard->account()->url().toString());
         break;
@@ -109,7 +109,7 @@ void OwncloudOAuthCredsPage::setConnected()
 
 AbstractCredentials *OwncloudOAuthCredsPage::getCredentials() const
 {
-    OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+    auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
     Q_ASSERT(ocWizard);
     return new HttpCredentialsGui(_user, _token, _refreshToken,
         ocWizard->_clientSslCertificate, ocWizard->_clientSslKey);
index ac93245c6785130c4e0fe9c625814ab7514f2096..954e3f47ba5c1758a7aa055eaed360f014752ce7 100644 (file)
@@ -133,7 +133,7 @@ void OwncloudSetupPage::slotLogin()
 {
     _ocWizard->setRegistration(false);
     _ui.login->setMaximumHeight(0);
-    QPropertyAnimation *animation = new QPropertyAnimation(_ui.login, "maximumHeight");
+    auto *animation = new QPropertyAnimation(_ui.login, "maximumHeight");
     animation->setDuration(0);
     animation->setStartValue(500);
     animation->setEndValue(500);
@@ -210,7 +210,7 @@ void OwncloudSetupPage::initializePage()
     _checking = false;
 
     QAbstractButton *nextButton = wizard()->button(QWizard::NextButton);
-    QPushButton *pushButton = qobject_cast<QPushButton *>(nextButton);
+    auto *pushButton = qobject_cast<QPushButton *>(nextButton);
     if (pushButton)
         pushButton->setDefault(true);
 
index 4e598d2c72b15d24a1ff769cc21210dca3a39bab..3469b42dcf1e6fb229752db7fa27f26fd250b00a 100644 (file)
@@ -37,13 +37,13 @@ void OwncloudShibbolethCredsPage::setupBrowser()
     if (!_browser.isNull()) {
         return;
     }
-    OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+    auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
     AccountPtr account = ocWizard->account();
 
     // we need to reset the cookie jar to drop temporary cookies (like the shib cookie)
     // i.e. if someone presses "back"
     QNetworkAccessManager *qnam = account->networkAccessManager();
-    CookieJar *jar = new CookieJar;
+    auto *jar = new CookieJar;
     jar->restore(account->cookieJarPath());
     // Implicitly deletes the old cookie jar, and reparents the jar
     qnam->setCookieJar(jar);
index a901be10352711493a28cfb360c3d55935b10c7e..86f3df736d879657ec36c1647ca0e94e47bf6d7b 100644 (file)
@@ -184,7 +184,7 @@ WebEnginePage::WebEnginePage(QWebEngineProfile *profile, QObject* parent) : QWeb
 
 QWebEnginePage * WebEnginePage::createWindow(QWebEnginePage::WebWindowType type) {
     Q_UNUSED(type);
-    ExternalWebEnginePage *view = new ExternalWebEnginePage(this->profile());
+    auto *view = new ExternalWebEnginePage(this->profile());
     return view;
 }
 
index 8daa0f6841abc09c9971e0134bb038133da9c3ed..f9c5a269eb6fe5a593a285cc801ae34bc4c75dd9 100644 (file)
@@ -23,7 +23,7 @@ WebViewPage::WebViewPage(QWidget *parent)
     qCInfo(lcWizardWebiewPage()) << "Time for a webview!";
     _webView = new WebView(this);
 
-    QVBoxLayout *layout = new QVBoxLayout(this);
+    auto *layout = new QVBoxLayout(this);
     layout->addWidget(_webView);
     setLayout(layout);
 
index 97ae971a41bd9b7ae2f71d726764a8e3d9bd81b4..6908cd3b0ff3d10c1fa32f7f7de8c01739eddff5 100644 (file)
@@ -534,12 +534,12 @@ void Account::writeAppPasswordOnce(QString appPassword){
                 id()
     );
 
-    WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+    auto *job = new WritePasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     job->setBinaryData(appPassword.toLatin1());
     connect(job, &WritePasswordJob::finished, [this](Job *incoming) {
-        WritePasswordJob *writeJob = static_cast<WritePasswordJob *>(incoming);
+        auto *writeJob = static_cast<WritePasswordJob *>(incoming);
         if (writeJob->error() == NoError)
             qCInfo(lcAccount) << "appPassword stored in keychain";
         else
@@ -558,11 +558,11 @@ void Account::retrieveAppPassword(){
                 id()
     );
 
-    ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
+    auto *job = new ReadPasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     connect(job, &ReadPasswordJob::finished, [this](Job *incoming) {
-        ReadPasswordJob *readJob = static_cast<ReadPasswordJob *>(incoming);
+        auto *readJob = static_cast<ReadPasswordJob *>(incoming);
         QString pwd("");
         // Error or no valid public key error out
         if (readJob->error() == NoError &&
@@ -587,11 +587,11 @@ void Account::deleteAppPassword(){
         return;
     }
 
-    DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
+    auto *job = new DeletePasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     connect(job, &DeletePasswordJob::finished, [this](Job *incoming) {
-        DeletePasswordJob *deleteJob = static_cast<DeletePasswordJob *>(incoming);
+        auto *deleteJob = static_cast<DeletePasswordJob *>(incoming);
         if (deleteJob->error() == NoError)
             qCInfo(lcAccount) << "appPassword deleted from keychain";
         else
@@ -612,7 +612,7 @@ void Account::fetchDirectEditors(const QUrl &directEditingURL, const QString &di
     if (!directEditingURL.isEmpty() &&
         (directEditingETag.isEmpty() || directEditingETag != _lastDirectEditingETag)) {
             // Fetch the available editors and their mime types
-            JsonApiJob *job = new JsonApiJob(sharedFromThis(), QLatin1String("ocs/v2.php/apps/files/api/v1/directEditing"), this);
+            auto *job = new JsonApiJob(sharedFromThis(), QLatin1String("ocs/v2.php/apps/files/api/v1/directEditing"), this);
             QObject::connect(job, &JsonApiJob::jsonReceived, this, &Account::slotDirectEditingRecieved);
             job->start();
     }
@@ -633,7 +633,7 @@ void Account::slotDirectEditingRecieved(const QJsonDocument &json)
             auto mimeTypes = editor.value("mimetypes").toArray();
             auto optionalMimeTypes = editor.value("optionalMimetypes").toArray();
 
-            DirectEditor *directEditor = new DirectEditor(id, name);
+            auto *directEditor = new DirectEditor(id, name);
 
             foreach(auto mimeType, mimeTypes) {
                 directEditor->addMimetype(mimeType.toString().toLatin1());
index c7191105c965e893dac61b43f49b358e60a14e6b..95564bb7b4c2ad049939bccd12a0c3a96dc545ba 100644 (file)
@@ -139,7 +139,7 @@ void BandwidthManager::registerDownloadJob(GETFileJob *j)
 
 void BandwidthManager::unregisterDownloadJob(QObject *o)
 {
-    GETFileJob *j = reinterpret_cast<GETFileJob *>(o); // note, we might already be in the ~QObject
+    auto *j = reinterpret_cast<GETFileJob *>(o); // note, we might already be in the ~QObject
     _downloadJobList.removeAll(j);
     if (_relativeLimitCurrentMeasuredJob == j) {
         _relativeLimitCurrentMeasuredJob = nullptr;
index be2de5c2ca1aa1bab4816f2da8704b76ddac2cca..151ebcabd6670cf02096dd1805e5605178cefd85 100644 (file)
@@ -91,7 +91,7 @@ QByteArray generateRandomFilename()
 
 QByteArray generateRandom(int size)
 {
-    unsigned char *tmp = (unsigned char *)malloc(sizeof(unsigned char) * size);
+    auto *tmp = (unsigned char *)malloc(sizeof(unsigned char) * size);
 
     int ret = RAND_bytes(tmp, size);
     if (ret != 1) {
@@ -175,7 +175,7 @@ QByteArray encryptPrivateKey(
     QByteArray privateKeyB64 = privateKey.toBase64();
 
     // Make sure we have enough room in the cipher text
-    unsigned char *ctext = (unsigned char *)malloc(sizeof(unsigned char) * (privateKeyB64.size() + 32));
+    auto *ctext = (unsigned char *)malloc(sizeof(unsigned char) * (privateKeyB64.size() + 32));
 
     // Do the actual encryption
     int len = 0;
@@ -196,7 +196,7 @@ QByteArray encryptPrivateKey(
     clen += len;
 
     /* Get the tag */
-    unsigned char *tag = (unsigned char *)calloc(sizeof(unsigned char), 16);
+    auto *tag = (unsigned char *)calloc(sizeof(unsigned char), 16);
     if(1 != EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, 16, tag)) {
         qCInfo(lcCse()) << "Error getting the tag";
         handleErrors();
@@ -263,7 +263,7 @@ QByteArray decryptPrivateKey(const QByteArray& key, const QByteArray& data) {
         return QByteArray();
     }
 
-    unsigned char *ptext = (unsigned char *)calloc(cipherTXT.size() + 16, sizeof(unsigned char));
+    auto *ptext = (unsigned char *)calloc(cipherTXT.size() + 16, sizeof(unsigned char));
     int plen;
 
     /* Provide the message to be decrypted, and obtain the plaintext output.
@@ -352,7 +352,7 @@ QByteArray decryptStringSymmetric(const QByteArray& key, const QByteArray& data)
         return QByteArray();
     }
 
-    unsigned char *ptext = (unsigned char *)calloc(cipherTXT.size() + 16, sizeof(unsigned char));
+    auto *ptext = (unsigned char *)calloc(cipherTXT.size() + 16, sizeof(unsigned char));
     int plen;
 
     /* Provide the message to be decrypted, and obtain the plaintext output.
@@ -447,7 +447,7 @@ QByteArray encryptStringSymmetric(const QByteArray& key, const QByteArray& data)
     QByteArray dataB64 = data.toBase64();
 
     // Make sure we have enough room in the cipher text
-    unsigned char *ctext = (unsigned char *)malloc(sizeof(unsigned char) * (dataB64.size() + 16));
+    auto *ctext = (unsigned char *)malloc(sizeof(unsigned char) * (dataB64.size() + 16));
 
     // Do the actual encryption
     int len = 0;
@@ -470,7 +470,7 @@ QByteArray encryptStringSymmetric(const QByteArray& key, const QByteArray& data)
     clen += len;
 
     /* Get the tag */
-    unsigned char *tag = (unsigned char *)calloc(sizeof(unsigned char), 16);
+    auto *tag = (unsigned char *)calloc(sizeof(unsigned char), 16);
     if(1 != EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, 16, tag)) {
         qCInfo(lcCse()) << "Error getting the tag";
         handleErrors();
@@ -534,7 +534,7 @@ QByteArray decryptStringAsymmetric(EVP_PKEY *privateKey, const QByteArray& data)
         qCInfo(lcCseDecryption()) << "Size of data is: " << data.size();
     }
 
-    unsigned char *out = (unsigned char *) OPENSSL_malloc(outlen);
+    auto *out = (unsigned char *) OPENSSL_malloc(outlen);
     if (!out) {
         qCInfo(lcCseDecryption()) << "Could not alloc space for the decrypted metadata";
         handleErrors();
@@ -592,7 +592,7 @@ QByteArray encryptStringAsymmetric(EVP_PKEY *publicKey, const QByteArray& data)
         qCInfo(lcCse()) << "Encryption Length:" << outLen;
     }
 
-    unsigned char *out = (uchar*) OPENSSL_malloc(outLen);
+    auto *out = (uchar*) OPENSSL_malloc(outLen);
     if (!out) {
         qCInfo(lcCse()) << "Error requesting memory for the encrypted contents";
         exit(1);
@@ -638,7 +638,7 @@ void ClientSideEncryption::fetchFromKeyChain() {
                 _account->id()
     );
 
-    ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
+    auto *job = new ReadPasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     connect(job, &ReadPasswordJob::finished, this, &ClientSideEncryption::publicKeyFetched);
@@ -646,7 +646,7 @@ void ClientSideEncryption::fetchFromKeyChain() {
 }
 
 void ClientSideEncryption::publicKeyFetched(Job *incoming) {
-    ReadPasswordJob *readJob = static_cast<ReadPasswordJob *>(incoming);
+    auto *readJob = static_cast<ReadPasswordJob *>(incoming);
 
     // Error or no valid public key error out
     if (readJob->error() != NoError || readJob->binaryData().length() == 0) {
@@ -671,7 +671,7 @@ void ClientSideEncryption::publicKeyFetched(Job *incoming) {
                 _account->id()
     );
 
-    ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
+    auto *job = new ReadPasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     connect(job, &ReadPasswordJob::finished, this, &ClientSideEncryption::privateKeyFetched);
@@ -685,7 +685,7 @@ void ClientSideEncryption::setFolderEncryptedStatus(const QString& folder, bool
 }
 
 void ClientSideEncryption::privateKeyFetched(Job *incoming) {
-    ReadPasswordJob *readJob = static_cast<ReadPasswordJob *>(incoming);
+    auto *readJob = static_cast<ReadPasswordJob *>(incoming);
 
     // Error or no valid public key error out
     if (readJob->error() != NoError || readJob->binaryData().length() == 0) {
@@ -711,7 +711,7 @@ void ClientSideEncryption::privateKeyFetched(Job *incoming) {
                 _account->id()
     );
 
-    ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
+    auto *job = new ReadPasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     connect(job, &ReadPasswordJob::finished, this, &ClientSideEncryption::mnemonicKeyFetched);
@@ -719,7 +719,7 @@ void ClientSideEncryption::privateKeyFetched(Job *incoming) {
 }
 
 void ClientSideEncryption::mnemonicKeyFetched(QKeychain::Job *incoming) {
-    ReadPasswordJob *readJob = static_cast<ReadPasswordJob *>(incoming);
+    auto *readJob = static_cast<ReadPasswordJob *>(incoming);
 
     // Error or no valid public key error out
     if (readJob->error() != NoError || readJob->textData().length() == 0) {
@@ -744,7 +744,7 @@ void ClientSideEncryption::writePrivateKey() {
                 _account->id()
     );
 
-    WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+    auto *job = new WritePasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     job->setBinaryData(_privateKey);
@@ -762,7 +762,7 @@ void ClientSideEncryption::writeCertificate() {
                 _account->id()
     );
 
-    WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+    auto *job = new WritePasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     job->setBinaryData(_certificate.toPem());
@@ -780,7 +780,7 @@ void ClientSideEncryption::writeMnemonic() {
                 _account->id()
     );
 
-    WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+    auto *job = new WritePasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);
     job->setKey(kck);
     job->setTextData(_mnemonic);
@@ -799,7 +799,7 @@ void ClientSideEncryption::forgetSensitiveData()
     _mnemonic = QString();
 
     auto startDeleteJob = [this](QString user) {
-        DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
+        auto *job = new DeletePasswordJob(Theme::instance()->appName());
         job->setInsecureFallback(false);
         job->setKey(AbstractCredentials::keychainKey(_account->url().toString(), user, _account->id()));
         job->start();
@@ -1408,7 +1408,7 @@ bool EncryptionHelper::fileEncryption(const QByteArray &key, const QByteArray &i
         return false;
     }
 
-    unsigned char *out = (unsigned char *)malloc(sizeof(unsigned char) * (1024 + 16 -1));
+    auto *out = (unsigned char *)malloc(sizeof(unsigned char) * (1024 + 16 -1));
     int len = 0;
     int total_len = 0;
 
@@ -1439,7 +1439,7 @@ bool EncryptionHelper::fileEncryption(const QByteArray &key, const QByteArray &i
     total_len += len;
 
     /* Get the tag */
-    unsigned char *tag = (unsigned char *)malloc(sizeof(unsigned char) * 16);
+    auto *tag = (unsigned char *)malloc(sizeof(unsigned char) * 16);
     if(1 != EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, 16, tag)) {
         qCInfo(lcCse()) << "Could not get tag";
         return false;
@@ -1495,7 +1495,7 @@ bool EncryptionHelper::fileDecryption(const QByteArray &key, const QByteArray& i
 
     qint64 size = input->size() - 16;
 
-    unsigned char *out = (unsigned char *)malloc(sizeof(unsigned char) * (1024 + 16 -1));
+    auto *out = (unsigned char *)malloc(sizeof(unsigned char) * (1024 + 16 -1));
     int len = 0;
 
     while(input->pos() < size) {
index 5321f938aca2c12440419b58f958c5d27a0bbb2f..7608ee9563ce49ae8c0c6a1eca022d861f706a35 100644 (file)
@@ -37,7 +37,7 @@ void GetFolderEncryptStatusJob::start()
     req.setHeader(QNetworkRequest::ContentTypeHeader, QByteArrayLiteral("application/xml"));
 
        QByteArray xml = "<d:propfind xmlns:d=\"DAV:\"> <d:prop xmlns:nc=\"http://nextcloud.org/ns\"> <nc:is-encrypted/> </d:prop> </d:propfind>";
-       QBuffer *buf = new QBuffer(this);
+       auto *buf = new QBuffer(this);
        buf->setData(xml);
        buf->open(QIODevice::ReadOnly);
   QString tmpPath = path() + (!_folder.isEmpty() ? "/" + _folder : QString());
index fbe01331ea92520d1e00f290d2aacae3504dcab2..31c70a11996d06e881c9dadba4f2b83b76ff5b65 100644 (file)
@@ -195,7 +195,7 @@ void HttpCredentials::fetchFromKeychainHelper()
         _user + clientCertificatePEMC,
         _keychainMigration ? QString() : _account->id());
 
-    ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
+    auto *job = new ReadPasswordJob(Theme::instance()->appName());
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
     job->setKey(kck);
@@ -206,7 +206,7 @@ void HttpCredentials::fetchFromKeychainHelper()
 void HttpCredentials::deleteOldKeychainEntries()
 {
     auto startDeleteJob = [this](QString user) {
-        DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
+        auto *job = new DeletePasswordJob(Theme::instance()->appName());
         addSettingsToJob(_account, job);
         job->setInsecureFallback(true);
         job->setKey(keychainKey(_account->url().toString(), user, QString()));
@@ -236,7 +236,7 @@ void HttpCredentials::slotReadClientCertPEMJobDone(QKeychain::Job *incoming)
 #endif
 
     // Store PEM in memory
-    ReadPasswordJob *readJob = static_cast<ReadPasswordJob *>(incoming);
+    auto *readJob = static_cast<ReadPasswordJob *>(incoming);
     if (readJob->error() == NoError && readJob->binaryData().length() > 0) {
         QList<QSslCertificate> sslCertificateList = QSslCertificate::fromData(readJob->binaryData(), QSsl::Pem);
         if (sslCertificateList.length() >= 1) {
@@ -250,7 +250,7 @@ void HttpCredentials::slotReadClientCertPEMJobDone(QKeychain::Job *incoming)
         _user + clientKeyPEMC,
         _keychainMigration ? QString() : _account->id());
 
-    ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
+    auto *job = new ReadPasswordJob(Theme::instance()->appName());
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
     job->setKey(kck);
@@ -261,7 +261,7 @@ void HttpCredentials::slotReadClientCertPEMJobDone(QKeychain::Job *incoming)
 void HttpCredentials::slotReadClientKeyPEMJobDone(QKeychain::Job *incoming)
 {
     // Store key in memory
-    ReadPasswordJob *readJob = static_cast<ReadPasswordJob *>(incoming);
+    auto *readJob = static_cast<ReadPasswordJob *>(incoming);
 
     if (readJob->error() == NoError && readJob->binaryData().length() > 0) {
         QByteArray clientKeyPEM = readJob->binaryData();
@@ -285,7 +285,7 @@ void HttpCredentials::slotReadClientKeyPEMJobDone(QKeychain::Job *incoming)
         _user,
         _keychainMigration ? QString() : _account->id());
 
-    ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
+    auto *job = new ReadPasswordJob(Theme::instance()->appName());
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
     job->setKey(kck);
@@ -304,7 +304,7 @@ bool HttpCredentials::stillValid(QNetworkReply *reply)
 
 void HttpCredentials::slotReadJobDone(QKeychain::Job *incomingJob)
 {
-    QKeychain::ReadPasswordJob *job = static_cast<ReadPasswordJob *>(incomingJob);
+    auto *job = static_cast<ReadPasswordJob *>(incomingJob);
     QKeychain::Error error = job->error();
 
     // If we can't find the credentials at the keys that include the account id,
@@ -425,7 +425,7 @@ void HttpCredentials::invalidateToken()
         return;
     }
 
-    DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
+    auto *job = new DeletePasswordJob(Theme::instance()->appName());
     addSettingsToJob(_account, job);
     job->setInsecureFallback(true);
     job->setKey(kck);
@@ -461,7 +461,7 @@ void HttpCredentials::persist()
 
     // write cert if there is one
     if (!_clientSslCertificate.isNull()) {
-        WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+        auto *job = new WritePasswordJob(Theme::instance()->appName());
         addSettingsToJob(_account, job);
         job->setInsecureFallback(false);
         connect(job, &Job::finished, this, &HttpCredentials::slotWriteClientCertPEMJobDone);
@@ -477,7 +477,7 @@ void HttpCredentials::slotWriteClientCertPEMJobDone()
 {
     // write ssl key if there is one
     if (!_clientSslKey.isNull()) {
-        WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+        auto *job = new WritePasswordJob(Theme::instance()->appName());
         addSettingsToJob(_account, job);
         job->setInsecureFallback(false);
         connect(job, &Job::finished, this, &HttpCredentials::slotWriteClientKeyPEMJobDone);
@@ -491,7 +491,7 @@ void HttpCredentials::slotWriteClientCertPEMJobDone()
 
 void HttpCredentials::slotWriteClientKeyPEMJobDone()
 {
-    WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+    auto *job = new WritePasswordJob(Theme::instance()->appName());
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
     connect(job, &Job::finished, this, &HttpCredentials::slotWriteJobDone);
@@ -509,7 +509,7 @@ void HttpCredentials::slotWriteJobDone(QKeychain::Job *job)
     default:
         qCWarning(lcHttpCredentials) << "Error while writing password" << job->errorString();
     }
-    WritePasswordJob *wjob = qobject_cast<WritePasswordJob *>(job);
+    auto *wjob = qobject_cast<WritePasswordJob *>(job);
     wjob->deleteLater();
 }
 
index b5780143b6332238333863bb021da239d02f45f6..3c25fe38ac1270f283dfc1371139eae4d14a0091 100644 (file)
@@ -156,7 +156,7 @@ void DiscoveryJob::update_job_update_callback(bool local,
     const char *dirUrl,
     void *userdata)
 {
-    DiscoveryJob *updateJob = static_cast<DiscoveryJob *>(userdata);
+    auto *updateJob = static_cast<DiscoveryJob *>(userdata);
     if (updateJob) {
         // Don't wanna overload the UI
         if (!updateJob->_lastUpdateProgressCallbackCall.isValid()) {
@@ -263,7 +263,7 @@ DiscoverySingleDirectoryJob::DiscoverySingleDirectoryJob(const AccountPtr &accou
 void DiscoverySingleDirectoryJob::start()
 {
     // Start the actual HTTP job
-    LsColJob *lsColJob = new LsColJob(_account, _subPath, this);
+    auto *lsColJob = new LsColJob(_account, _subPath, this);
 
     QList<QByteArray> props;
     props << "resourcetype"
@@ -652,7 +652,7 @@ void DiscoveryMainThread::abort()
 csync_vio_handle_t *DiscoveryJob::remote_vio_opendir_hook(const char *url,
     void *userdata)
 {
-    DiscoveryJob *discoveryJob = static_cast<DiscoveryJob *>(userdata);
+    auto *discoveryJob = static_cast<DiscoveryJob *>(userdata);
     if (discoveryJob) {
         qCDebug(lcDiscovery) << discoveryJob << url << "Calling into main thread...";
 
@@ -685,9 +685,9 @@ csync_vio_handle_t *DiscoveryJob::remote_vio_opendir_hook(const char *url,
 std::unique_ptr<csync_file_stat_t> DiscoveryJob::remote_vio_readdir_hook(csync_vio_handle_t *dhandle,
     void *userdata)
 {
-    DiscoveryJob *discoveryJob = static_cast<DiscoveryJob *>(userdata);
+    auto *discoveryJob = static_cast<DiscoveryJob *>(userdata);
     if (discoveryJob) {
-        DiscoveryDirectoryResult *directoryResult = static_cast<DiscoveryDirectoryResult *>(dhandle);
+        auto *directoryResult = static_cast<DiscoveryDirectoryResult *>(dhandle);
         if (!directoryResult->list.empty()) {
             auto file_stat = std::move(directoryResult->list.front());
             directoryResult->list.pop_front();
@@ -699,9 +699,9 @@ std::unique_ptr<csync_file_stat_t> DiscoveryJob::remote_vio_readdir_hook(csync_v
 
 void DiscoveryJob::remote_vio_closedir_hook(csync_vio_handle_t *dhandle, void *userdata)
 {
-    DiscoveryJob *discoveryJob = static_cast<DiscoveryJob *>(userdata);
+    auto *discoveryJob = static_cast<DiscoveryJob *>(userdata);
     if (discoveryJob) {
-        DiscoveryDirectoryResult *directoryResult = static_cast<DiscoveryDirectoryResult *>(dhandle);
+        auto *directoryResult = static_cast<DiscoveryDirectoryResult *>(dhandle);
         QString path = directoryResult->path;
         qCDebug(lcDiscovery) << discoveryJob << path;
         // just deletes the struct and the iterator, the data itself is owned by the SyncEngine/DiscoveryMainThread
index 20e00f1a9a07e4e2daa5ef0c3982e9a546d3177a..c1bf86d4211825797f68f6cb601498f675cd21c6 100644 (file)
@@ -78,7 +78,7 @@ void RequestEtagJob::start()
                    "    <d:getetag/>\n"
                    "  </d:prop>\n"
                    "</d:propfind>\n");
-    QBuffer *buf = new QBuffer(this);
+    auto *buf = new QBuffer(this);
     buf->setData(xml);
     buf->open(QIODevice::ReadOnly);
     // assumes ownership
@@ -343,7 +343,7 @@ void LsColJob::start()
                    "  <d:prop>\n"
         + propStr + "  </d:prop>\n"
                     "</d:propfind>\n");
-    QBuffer *buf = new QBuffer(this);
+    auto *buf = new QBuffer(this);
     buf->setData(xml);
     buf->open(QIODevice::ReadOnly);
     if (_url.isValid()) {
@@ -565,7 +565,7 @@ void PropfindJob::start()
         + propStr + "  </d:prop>\n"
                     "</d:propfind>\n";
 
-    QBuffer *buf = new QBuffer(this);
+    auto *buf = new QBuffer(this);
     buf->setData(xml);
     buf->open(QIODevice::ReadOnly);
     sendRequest("PROPFIND", makeDavUrl(path()), req, buf);
@@ -727,7 +727,7 @@ void ProppatchJob::start()
         + propStr + "  </d:prop></d:set>\n"
                     "</d:propertyupdate>\n";
 
-    QBuffer *buf = new QBuffer(this);
+    auto *buf = new QBuffer(this);
     buf->setData(xml);
     buf->open(QIODevice::ReadOnly);
     sendRequest("PROPPATCH", makeDavUrl(path()), req, buf);
@@ -1040,7 +1040,7 @@ void fetchPrivateLinkUrl(AccountPtr account, const QString &remotePath,
         oldUrl = account->deprecatedPrivateLinkUrl(numericFileId).toString(QUrl::FullyEncoded);
 
     // Retrieve the new link by PROPFIND
-    PropfindJob *job = new PropfindJob(account, remotePath, target);
+    auto *job = new PropfindJob(account, remotePath, target);
     job->setProperties(
         QList<QByteArray>()
         << "http://owncloud.org/ns:fileid" // numeric file id for fallback private link generation
index 03d1dbf7244a7f71fdb240034c5579455b085d1b..1120681456b5b8c4d6ecd1f7e5f37c1b056f7fbf 100644 (file)
@@ -404,7 +404,7 @@ void OwncloudPropagator::start(const SyncFileItemVector &items,
     foreach (const SyncFileItemPtr &item, items) {
         if (!removedDirectory.isEmpty() && item->_file.startsWith(removedDirectory)) {
             // this is an item in a directory which is going to be removed.
-            PropagateDirectory *delDirJob = qobject_cast<PropagateDirectory *>(directoriesToRemove.first());
+            auto *delDirJob = qobject_cast<PropagateDirectory *>(directoriesToRemove.first());
 
             if (item->_instruction == CSYNC_INSTRUCTION_REMOVE) {
                 // already taken care of. (by the removal of the parent directory)
@@ -453,7 +453,7 @@ void OwncloudPropagator::start(const SyncFileItemVector &items,
         }
 
         if (item->isDirectory()) {
-            PropagateDirectory *dir = new PropagateDirectory(this, item);
+            auto *dir = new PropagateDirectory(this, item);
 
             if (item->_instruction == CSYNC_INSTRUCTION_TYPE_CHANGE
                 && item->_direction == SyncFileItem::Up) {
@@ -846,7 +846,7 @@ bool PropagatorCompositeJob::scheduleSelfOrChild()
 
 void PropagatorCompositeJob::slotSubJobFinished(SyncFileItem::Status status)
 {
-    PropagatorJob *subJob = static_cast<PropagatorJob *>(sender());
+    auto *subJob = static_cast<PropagatorJob *>(sender());
     ASSERT(subJob);
 
     // Delete the job and remove it from our list of jobs.
@@ -980,7 +980,7 @@ void PropagateDirectory::slotSubJobsFinished(SyncFileItem::Status status)
         if (_item->_instruction == CSYNC_INSTRUCTION_RENAME
             || _item->_instruction == CSYNC_INSTRUCTION_NEW
             || _item->_instruction == CSYNC_INSTRUCTION_UPDATE_METADATA) {
-            if (PropagateRemoteMkdir *mkdir = qobject_cast<PropagateRemoteMkdir *>(_firstJob.data())) {
+            if (auto *mkdir = qobject_cast<PropagateRemoteMkdir *>(_firstJob.data())) {
                 // special case from MKDIR, get the fileId from the job there
                 if (_item->_fileId.isEmpty() && !mkdir->_item->_fileId.isEmpty()) {
                     _item->_fileId = mkdir->_item->_fileId;
@@ -1018,7 +1018,7 @@ void CleanupPollsJob::start()
     SyncJournalFileRecord record;
     if (_journal->getFileRecord(info._file, &record) && record.isValid()) {
         SyncFileItemPtr item = SyncFileItem::fromSyncJournalFileRecord(record);
-        PollJob *job = new PollJob(_account, info._url, item, _journal, _localPath, this);
+        auto *job = new PollJob(_account, info._url, item, _journal, _localPath, this);
         connect(job, &PollJob::finishedSignal, this, &CleanupPollsJob::slotPollFinished);
         job->start();
     }
@@ -1026,7 +1026,7 @@ void CleanupPollsJob::start()
 
 void CleanupPollsJob::slotPollFinished()
 {
-    PollJob *job = qobject_cast<PollJob *>(sender());
+    auto *job = qobject_cast<PollJob *>(sender());
     ASSERT(job);
     if (job->_item->_status == SyncFileItem::FatalError) {
         emit aborted(job->_item->_errorString);
index df182ae4609f9c24de0ed2424ee3cc349c1593be..ab8a5c9a970a05a7d1290ff4f9f2f5442feee3a3 100644 (file)
@@ -686,7 +686,7 @@ void PropagateDownloadFile::slotGetFinished()
     // Do checksum validation for the download. If there is no checksum header, the validator
     // will also emit the validated() signal to continue the flow in slot transmissionChecksumValidated()
     // as this is (still) also correct.
-    ValidateChecksumHeader *validator = new ValidateChecksumHeader(this);
+    auto *validator = new ValidateChecksumHeader(this);
     connect(validator, &ValidateChecksumHeader::validated,
         this, &PropagateDownloadFile::transmissionChecksumValidated);
     connect(validator, &ValidateChecksumHeader::validationFailed,
index 6ba783a86e5ff455e2c8dc8177ee922a166beebe..34579b0810a03ce9185e668e359f4c4402d1c9c7 100644 (file)
@@ -509,7 +509,7 @@ void UploadDevice::setChoked(bool b)
 
 void PropagateUploadFileCommon::startPollJob(const QString &path)
 {
-    PollJob *job = new PollJob(propagator()->account(), path, _item,
+    auto *job = new PollJob(propagator()->account(), path, _item,
         propagator()->_journal, propagator()->_localDir, this);
     connect(job, &PollJob::finishedSignal, this, &PropagateUploadFileCommon::slotPollFinished);
     SyncJournalDb::PollInfo info;
@@ -524,7 +524,7 @@ void PropagateUploadFileCommon::startPollJob(const QString &path)
 
 void PropagateUploadFileCommon::slotPollFinished()
 {
-    PollJob *job = qobject_cast<PollJob *>(sender());
+    auto *job = qobject_cast<PollJob *>(sender());
     ASSERT(job);
 
     propagator()->_activeJobList.removeOne(this);
index bb93713ceee75db36eb471f5fa04f60cb2304947..78ce820894e795ba7ade2c47d6384c1a1d4f87b9 100644 (file)
@@ -329,7 +329,7 @@ void PropagateUploadFileNG::startNextChunk()
 
     // job takes ownership of device via a QScopedPointer. Job deletes itself when finishing
     auto devicePtr = device.get(); // for connections later
-    PUTFileJob *job = new PUTFileJob(propagator()->account(), url, std::move(device), headers, _currentChunk, this);
+    auto *job = new PUTFileJob(propagator()->account(), url, std::move(device), headers, _currentChunk, this);
     _jobs.append(job);
     connect(job, &PUTFileJob::finishedSignal, this, &PropagateUploadFileNG::slotPutFinished);
     connect(job, &PUTFileJob::uploadProgress,
@@ -344,7 +344,7 @@ void PropagateUploadFileNG::startNextChunk()
 
 void PropagateUploadFileNG::slotPutFinished()
 {
-    PUTFileJob *job = qobject_cast<PUTFileJob *>(sender());
+    auto *job = qobject_cast<PUTFileJob *>(sender());
     ASSERT(job);
 
     slotJobDestroyed(job); // remove it from the _jobs list
index 104fa9d752e4cd380caa027050ddaab4d7a9a92a..29c8b4b1a4865cfe973e9ee9c27646b5c6a54d1a 100644 (file)
@@ -139,7 +139,7 @@ void PropagateUploadFileV1::startNextChunk()
 
     // job takes ownership of device via a QScopedPointer. Job deletes itself when finishing
     auto devicePtr = device.get(); // for connections later
-    PUTFileJob *job = new PUTFileJob(propagator()->account(), propagator()->_remoteFolder + path, std::move(device), headers, _currentChunk, this);
+    auto *job = new PUTFileJob(propagator()->account(), propagator()->_remoteFolder + path, std::move(device), headers, _currentChunk, this);
     _jobs.append(job);
     connect(job, &PUTFileJob::finishedSignal, this, &PropagateUploadFileV1::slotPutFinished);
     connect(job, &PUTFileJob::uploadProgress, this, &PropagateUploadFileV1::slotUploadProgress);
@@ -187,7 +187,7 @@ void PropagateUploadFileV1::startNextChunk()
 
 void PropagateUploadFileV1::slotPutFinished()
 {
-    PUTFileJob *job = qobject_cast<PUTFileJob *>(sender());
+    auto *job = qobject_cast<PUTFileJob *>(sender());
     ASSERT(job);
 
     slotJobDestroyed(job); // remove it from the _jobs list
@@ -357,7 +357,7 @@ void PropagateUploadFileV1::abort(PropagatorJob::AbortType abortType)
     abortNetworkJobs(
         abortType,
         [this, abortType](AbstractNetworkJob *job) {
-            if (PUTFileJob *putJob = qobject_cast<PUTFileJob *>(job)){
+            if (auto *putJob = qobject_cast<PUTFileJob *>(job)){
                 if (abortType == AbortType::Asynchronous
                     && _chunkCount > 0
                     && (((_currentChunk + _startChunk) % _chunkCount) == 0)
index 91be03ebb8612cc33514f45f26dca92d123f5bab..c34317ac87e8c4dff023e92cb8c655af22d4a2ee 100644 (file)
@@ -765,7 +765,7 @@ void SyncEngine::startSync()
         QVector<SyncJournalDb::PollInfo> pollInfos = _journal->getPollInfos();
         if (!pollInfos.isEmpty()) {
             qCInfo(lcEngine) << "Finish Poll jobs before starting a sync";
-            CleanupPollsJob *job = new CleanupPollsJob(pollInfos, _account,
+            auto *job = new CleanupPollsJob(pollInfos, _account,
                 _journal, _localPath, this);
             connect(job, &CleanupPollsJob::finished, this, &SyncEngine::startSync);
             connect(job, &CleanupPollsJob::aborted, this, &SyncEngine::slotCleanPollsJobAborted);
@@ -899,7 +899,7 @@ void SyncEngine::startSync()
         connect(_discoveryMainThread.data(), &DiscoveryMainThread::etagConcatenation, this, &SyncEngine::slotRootEtagReceived);
     }
 
-    DiscoveryJob *discoveryJob = new DiscoveryJob(_csync_ctx.data());
+    auto *discoveryJob = new DiscoveryJob(_csync_ctx.data());
     discoveryJob->_selectiveSyncBlackList = selectiveSyncBlackList;
     discoveryJob->_selectiveSyncWhiteList =
         _journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, &ok);
index 041dc193cfdfd056afce455ef6caa75faa2ead42..f24f8977dbb05337b8ba004e5af616884f189be3 100644 (file)
@@ -63,7 +63,7 @@ using namespace OCC;
 #ifndef ZLIB_FOUND
         QSKIP("ZLIB not found.", SkipSingle);
 #else
-        ComputeChecksum *vali = new ComputeChecksum(this);
+        auto *vali = new ComputeChecksum(this);
         _expectedType = "Adler32";
         vali->setChecksumType(_expectedType);
 
@@ -83,7 +83,7 @@ using namespace OCC;
 
     void testUploadChecksummingMd5() {
 
-        ComputeChecksum *vali = new ComputeChecksum(this);
+        auto *vali = new ComputeChecksum(this);
         _expectedType = OCC::checkSumMD5C;
         vali->setChecksumType(_expectedType);
         connect(vali, SIGNAL(done(QByteArray,QByteArray)), this, SLOT(slotUpValidated(QByteArray,QByteArray)));
@@ -100,7 +100,7 @@ using namespace OCC;
 
     void testUploadChecksummingSha1() {
 
-        ComputeChecksum *vali = new ComputeChecksum(this);
+        auto *vali = new ComputeChecksum(this);
         _expectedType = OCC::checkSumSHA1C;
         vali->setChecksumType(_expectedType);
         connect(vali, SIGNAL(done(QByteArray,QByteArray)), this, SLOT(slotUpValidated(QByteArray,QByteArray)));
@@ -125,7 +125,7 @@ using namespace OCC;
         adler.append(FileSystem::calcAdler32( _testfile ));
         _successDown = false;
 
-        ValidateChecksumHeader *vali = new ValidateChecksumHeader(this);
+        auto *vali = new ValidateChecksumHeader(this);
         connect(vali, SIGNAL(validated(QByteArray,QByteArray)), this, SLOT(slotDownValidated()));
         connect(vali, SIGNAL(validationFailed(QString)), this, SLOT(slotDownError(QString)));
         vali->start(_testfile, adler);
index 8af45f0dff4dc243b8c40f7e80f3892ab38f0465..6d9263db45c9c13b191152808f218d1d81945f49 100644 (file)
@@ -45,7 +45,7 @@ private slots:
 
         AccountPtr account = Account::create();
         QUrl url("http://example.de");
-        HttpCredentialsTest *cred = new HttpCredentialsTest("testuser", "secret");
+        auto *cred = new HttpCredentialsTest("testuser", "secret");
         account->setCredentials(cred);
         account->setUrl( url );
 
@@ -153,7 +153,7 @@ private slots:
 
         AccountPtr account = Account::create();
         QUrl url("http://example.de");
-        HttpCredentialsTest *cred = new HttpCredentialsTest("testuser", "secret");
+        auto *cred = new HttpCredentialsTest("testuser", "secret");
         account->setCredentials(cred);
         account->setUrl( url );
         url.setUserName(cred->user());
index 43117fea417a4c1732741b44c062194dbb17958c..6ab28af4227bd661413107c222bf7bb231559354 100644 (file)
@@ -317,7 +317,7 @@ private slots:
         });
 
         // For directly editing the remote checksum
-        FileInfo &remoteInfo = dynamic_cast<FileInfo &>(fakeFolder.remoteModifier());
+        auto &remoteInfo = dynamic_cast<FileInfo &>(fakeFolder.remoteModifier());
 
         // Base mtime with no ms content (filesystem is seconds only)
         auto mtime = QDateTime::currentDateTimeUtc().addDays(-4);