Use auto to avoiding repeating type names

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
Kevin Ottens 2020-05-18 20:54:23 +02:00 committed by Michael Schuster
parent 3d2de4fc40
commit 712869db9a
65 changed files with 242 additions and 242 deletions

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

View 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;
}

View 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;

View 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 {

View 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"));

View 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";

View 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;

View 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

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

View 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
}

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

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

View 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) {

View 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();

View 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();

View 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();

View 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;

View 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());

View 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;
}

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

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

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

View 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") {

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

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

View 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());

View 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;

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

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

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

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

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

View 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());

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

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

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

View 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;

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

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

View 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;
}

View 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();

View 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,

View 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;

View 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();

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

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

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

View 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;
}

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

View 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());

View 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;

View 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) {

View 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());

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

View 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

View 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

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

View 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,

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

View 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

View 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)

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

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

View 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());

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