Fix: clang-tidy
This commit is contained in:
parent
b7dd89c68e
commit
24d2d17de0
9 changed files with 322 additions and 516 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -294,7 +294,6 @@ void DownloadManager::downloadFinished(QNetworkReply *reply)
|
|||
db->updateEntriesCachedFlagByEntry(item.entryId,QDateTime::currentDateTime().toTime_t(),2);
|
||||
break;
|
||||
case QNetworkReply::HostNotFoundError:
|
||||
//db->updateEntriesCachedFlagByEntry(item.entryId,QDateTime::currentDateTime().toTime_t(),4);
|
||||
break;
|
||||
case QNetworkReply::AuthenticationRequiredError:
|
||||
db->updateEntriesCachedFlagByEntry(item.entryId,QDateTime::currentDateTime().toTime_t(),5);
|
||||
|
|
@ -707,15 +706,13 @@ void DownloadManager::onlineDownload(const QString& id, const QString& url)
|
|||
if (!id.isEmpty()) {
|
||||
item = db->readCacheByEntry(id);
|
||||
if (item.id.isEmpty()) {
|
||||
//qDebug() << "Search by id not found";
|
||||
// No cache item -> downloaing
|
||||
//qDebug() << "No cache item -> downloaing";
|
||||
item.entryId = id;
|
||||
item.origUrl = url;
|
||||
item.finalUrl = url;
|
||||
item.baseUrl = url;
|
||||
item.type = "online-item";
|
||||
emit addDownload(item);
|
||||
addDownload(item);
|
||||
return;
|
||||
}
|
||||
//qDebug() << "Item found by entryId! baseUrl=" << item.baseUrl;
|
||||
|
|
@ -727,7 +724,7 @@ void DownloadManager::onlineDownload(const QString& id, const QString& url)
|
|||
item.finalUrl = url;
|
||||
item.baseUrl = url;
|
||||
item.type = "online-item";
|
||||
emit addDownload(item);
|
||||
addDownload(item);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -754,7 +751,7 @@ void CacheCleaner::cleanOr()
|
|||
|
||||
if (cacheDir.exists()) {
|
||||
QFileInfoList infoList = cacheDir.entryInfoList(QDir::Files,QDir::Time);
|
||||
Q_FOREACH(QFileInfo info, infoList){
|
||||
foreach (const QFileInfo& info, infoList){
|
||||
if (info.created() < date) {
|
||||
if (QFile::remove(info.absoluteFilePath())) {
|
||||
qDebug() << "Cache cleaner:" << info.fileName() << "deleted";
|
||||
|
|
@ -821,7 +818,7 @@ bool CacheRemover::removeDir(const QString &dirName)
|
|||
QFileInfoList infoList = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst);
|
||||
total = infoList.count();
|
||||
//qDebug() << "total" << total;
|
||||
Q_FOREACH(QFileInfo info, infoList) {
|
||||
foreach (const QFileInfo& info, infoList) {
|
||||
if (doCancel)
|
||||
return result;
|
||||
|
||||
|
|
|
|||
|
|
@ -343,7 +343,6 @@ void Fetcher::mergeActionsIntoList(DatabaseManager::ActionsTypes typeSet,
|
|||
if (it2 != actionsList.end()) {
|
||||
bool inMerge = false;
|
||||
while (it2 != actionsList.end()) {
|
||||
|
||||
DatabaseManager::ActionsTypes type1 = (*it1).type;
|
||||
DatabaseManager::ActionsTypes type2 = (*it2).type;
|
||||
DatabaseManager::ActionsTypes newType;
|
||||
|
|
@ -358,7 +357,6 @@ void Fetcher::mergeActionsIntoList(DatabaseManager::ActionsTypes typeSet,
|
|||
}
|
||||
|
||||
if (type1 == type2 && typeOk) {
|
||||
|
||||
QString newId1 = (*it1).id1 + QString("&%1").arg((*it2).id1);
|
||||
QString newId2 = (*it1).id2 + QString("&%1").arg((*it2).id2);
|
||||
QString newId3 = (*it1).id3 + QString("&%1").arg((*it2).id3);
|
||||
|
|
@ -493,7 +491,7 @@ void Fetcher::saveImage(const QString &url)
|
|||
auto dm = DownloadManager::instance();
|
||||
auto conn1 = std::make_shared<QMetaObject::Connection>();
|
||||
auto conn2 = std::make_shared<QMetaObject::Connection>();
|
||||
*conn1 = connect(dm, &DownloadManager::downloadReady,
|
||||
*conn1 = connect(dm, &DownloadManager::downloadReady, this,
|
||||
[this, conn1, conn2](const QString &url,
|
||||
const QString &path, const QString &contentType) {
|
||||
//qDebug() << "Download finished:" << url << path << contentType;
|
||||
|
|
@ -501,7 +499,7 @@ void Fetcher::saveImage(const QString &url)
|
|||
disconnect(*conn1); disconnect(*conn2);
|
||||
copyImage(path, contentType);
|
||||
});
|
||||
*conn2 = connect(dm, &DownloadManager::downloadFailed,
|
||||
*conn2 = connect(dm, &DownloadManager::downloadFailed, this,
|
||||
[this, conn1, conn2](const QString &url) {
|
||||
qWarning() << "Image download error:" << url;
|
||||
disconnect(*conn1); disconnect(*conn2);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ public:
|
|||
class Fetcher : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_ENUMS(BusyType)
|
||||
Q_PROPERTY (bool busy READ isBusy NOTIFY busyChanged)
|
||||
Q_PROPERTY (BusyType busyType READ readBusyType NOTIFY busyChanged)
|
||||
|
||||
|
|
@ -68,6 +67,7 @@ public:
|
|||
CheckingCredentialsWaiting = 31,
|
||||
GettingAuthUrlWaiting = 41
|
||||
};
|
||||
Q_ENUM(BusyType)
|
||||
|
||||
explicit Fetcher(QObject *parent = 0);
|
||||
~Fetcher();
|
||||
|
|
|
|||
|
|
@ -236,8 +236,7 @@ void NvFetcher::fetchFeeds()
|
|||
content += "\"filter\":\"unread\",";
|
||||
content += QString("\"limit\":%1},\"streams\":[{\"id\":\"%2\",\"moduleId\":\"%3\"}]}")
|
||||
.arg(limitFeeds)
|
||||
.arg((*i).streamId)
|
||||
.arg((*i).moduleId);
|
||||
.arg((*i).streamId, (*i).moduleId);
|
||||
|
||||
//qDebug() << "streamId:" << (*i).streamId << "moduleId:" << (*i).moduleId;
|
||||
|
||||
|
|
@ -322,8 +321,7 @@ void NvFetcher::fetchFeedsUpdate()
|
|||
"\"streams\":[{\"id\":\"%3\",\"moduleId\":\"%4\"}]}")
|
||||
.arg(limitFeedsUpdate)
|
||||
.arg((*i).date)
|
||||
.arg((*i).streamId)
|
||||
.arg((*i).moduleId);
|
||||
.arg((*i).streamId, (*i).moduleId);
|
||||
|
||||
i = streamUpdateList.erase(i);
|
||||
++ii;
|
||||
|
|
@ -413,7 +411,7 @@ void NvFetcher::setAction()
|
|||
if (i != list.begin())
|
||||
actions += ",";
|
||||
|
||||
actions += QString("{\"id\":\"%1\",\"moduleId\":\"%2\"}").arg((*i).streamId).arg((*i).moduleId);
|
||||
actions += QString("{\"id\":\"%1\",\"moduleId\":\"%2\"}").arg((*i).streamId, (*i).moduleId);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
|
@ -441,7 +439,7 @@ void NvFetcher::setAction()
|
|||
if (i != list.begin())
|
||||
actions += ",";
|
||||
|
||||
actions += QString("{\"id\":\"%1\",\"moduleId\":\"%2\"}").arg((*i).streamId).arg((*i).moduleId);
|
||||
actions += QString("{\"id\":\"%1\",\"moduleId\":\"%2\"}").arg((*i).streamId, (*i).moduleId);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
|
@ -469,7 +467,7 @@ void NvFetcher::setAction()
|
|||
if (i != list.begin())
|
||||
actions += ",";
|
||||
|
||||
actions += QString("{\"id\":\"%1\",\"moduleId\":\"%2\"}").arg((*i).streamId).arg((*i).moduleId);
|
||||
actions += QString("{\"id\":\"%1\",\"moduleId\":\"%2\"}").arg((*i).streamId, (*i).moduleId);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
|
@ -498,7 +496,7 @@ void NvFetcher::setAction()
|
|||
|
||||
actions += QString("{\"streams\":[{\"id\":\"%1\",\"items\":[{"
|
||||
"\"id\":\"%2\",\"publishedAt\":%3}]}]}")
|
||||
.arg(action.id2).arg(action.id1).arg(action.date1);
|
||||
.arg(action.id2, action.id1).arg(action.date1);
|
||||
|
||||
//qDebug() << actions;
|
||||
}
|
||||
|
|
@ -1323,13 +1321,13 @@ void NvFetcher::storeTabs()
|
|||
if (t.icon=="" && obj["iconConfig"].isObject()) {
|
||||
doDownloadIcon = false;
|
||||
QJsonObject iconObj = obj["iconConfig"].toObject();
|
||||
t.icon = QString("image://nvicons/%1?%2").arg(iconObj["icon"].toString()).arg(iconObj["color"].toString());
|
||||
t.icon = QString("image://nvicons/%1?%2").arg(iconObj["icon"].toString(), iconObj["color"].toString());
|
||||
}
|
||||
#else
|
||||
if (t.icon=="" && obj["iconConfig"].type()==QVariant::Map) {
|
||||
doDownloadIcon = false;
|
||||
QVariantMap iconObj = obj["iconConfig"].toMap();
|
||||
t.icon = QString("image://nvicons/%1?%2").arg(iconObj["icon"].toString()).arg(iconObj["color"].toString());
|
||||
t.icon = QString("image://nvicons/%1?%2").arg(iconObj["icon"].toString(), iconObj["color"].toString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1493,8 +1491,7 @@ int NvFetcher::storeFeeds()
|
|||
if (st.link!="") {
|
||||
QUrl iconUrl(st.link);
|
||||
st.icon = QString("https://avatars.netvibes.com/favicon/%1://%2")
|
||||
.arg(iconUrl.scheme())
|
||||
.arg(iconUrl.host());
|
||||
.arg(iconUrl.scheme(), iconUrl.host());
|
||||
DatabaseManager::CacheItem item;
|
||||
item.origUrl = st.icon;
|
||||
item.finalUrl = st.icon;
|
||||
|
|
|
|||
|
|
@ -168,9 +168,8 @@ void OldReaderFetcher::setAction()
|
|||
break;
|
||||
case DatabaseManager::SetStreamReadAll:
|
||||
url.setUrl("https://theoldreader.com/reader/api/0/mark-all-as-read");
|
||||
body = QString("s=%1&ts=%2").arg(action.id1).arg(
|
||||
QString::number(db->readLastLastUpdateByStream(action.id1))+"000000"
|
||||
);
|
||||
body = QString("s=%1&ts=%2").arg(action.id1,
|
||||
QString::number(db->readLastLastUpdateByStream(action.id1))+"000000");
|
||||
break;
|
||||
case DatabaseManager::SetTabReadAll:
|
||||
if (action.id1 == "subscriptions") {
|
||||
|
|
@ -190,22 +189,20 @@ void OldReaderFetcher::setAction()
|
|||
}
|
||||
|
||||
url.setUrl("https://theoldreader.com/reader/api/0/mark-all-as-read");
|
||||
body = QString("s=%1&ts=%2").arg(action.id1).arg(
|
||||
QString::number(db->readLastLastUpdateByTab(action.id1))+"000000"
|
||||
);
|
||||
body = QString("s=%1&ts=%2").arg(action.id1,
|
||||
QString::number(db->readLastLastUpdateByTab(action.id1))+"000000");
|
||||
break;
|
||||
case DatabaseManager::SetAllRead:
|
||||
url.setUrl("https://theoldreader.com/reader/api/0/mark-all-as-read");
|
||||
body = QString("s=user/-/state/com.google/reading-list&ts=%1").arg(
|
||||
QString::number(db->readLastLastUpdateByDashboard(s->getDashboardInUse()))+"000000"
|
||||
);
|
||||
QString::number(db->readLastLastUpdateByDashboard(s->getDashboardInUse()))+"000000");
|
||||
break;
|
||||
case DatabaseManager::SetBroadcast:
|
||||
url.setUrl("https://theoldreader.com/reader/api/0/edit-tag");
|
||||
if (action.text == "")
|
||||
body = QString("a=user/-/state/com.google/broadcast&i=%1").arg(action.id1);
|
||||
else
|
||||
body = QString("a=user/-/state/com.google/broadcast&i=%1&annotation=%2").arg(action.id1).arg(action.text);
|
||||
body = QString("a=user/-/state/com.google/broadcast&i=%1&annotation=%2").arg(action.id1, action.text);
|
||||
break;
|
||||
case DatabaseManager::UnSetBroadcast:
|
||||
url.setUrl("https://theoldreader.com/reader/api/0/edit-tag");
|
||||
|
|
@ -391,7 +388,7 @@ void OldReaderFetcher::fetchStarredStream()
|
|||
.arg(limitAtOnce).arg(st));
|
||||
else
|
||||
url.setUrl(QString("https://theoldreader.com/reader/api/0/stream/contents?output=json&n=%1&c=%2&s=%3")
|
||||
.arg(limitAtOnce).arg(lastContinuation).arg(st));
|
||||
.arg(limitAtOnce).arg(lastContinuation, st));
|
||||
QNetworkRequest request(url);
|
||||
|
||||
request.setRawHeader("Authorization",QString("GoogleLogin auth=%1").arg(s->getCookie()).toLatin1());
|
||||
|
|
@ -426,7 +423,7 @@ void OldReaderFetcher::fetchLikedStream()
|
|||
.arg(limitAtOnce).arg(st));
|
||||
else
|
||||
url.setUrl(QString("https://theoldreader.com/reader/api/0/stream/contents?output=json&n=%1&c=%2&s=%3")
|
||||
.arg(limitAtOnce).arg(lastContinuation).arg(st));
|
||||
.arg(limitAtOnce).arg(lastContinuation, st));
|
||||
QNetworkRequest request(url);
|
||||
|
||||
request.setRawHeader("Authorization",QString("GoogleLogin auth=%1").arg(s->getCookie()).toLatin1());
|
||||
|
|
@ -461,7 +458,7 @@ void OldReaderFetcher::fetchBroadcastStream()
|
|||
.arg(limitAtOnce).arg(st));
|
||||
else
|
||||
url.setUrl(QString("https://theoldreader.com/reader/api/0/stream/contents?output=json&n=%1&c=%2&s=%3")
|
||||
.arg(limitAtOnce).arg(lastContinuation).arg(st));
|
||||
.arg(limitAtOnce).arg(lastContinuation, st));
|
||||
QNetworkRequest request(url);
|
||||
|
||||
request.setRawHeader("Authorization",QString("GoogleLogin auth=%1").arg(s->getCookie()).toLatin1());
|
||||
|
|
@ -499,7 +496,7 @@ void OldReaderFetcher::fetchUnreadStream()
|
|||
else
|
||||
url.setUrl(QString("https://theoldreader.com/reader/api/0/stream/contents?output=json&n=%1&c=%2&s=%3&xt=%4")
|
||||
.arg(limitAtOnce)
|
||||
.arg(lastContinuation).arg(st1, st2));
|
||||
.arg(lastContinuation, st1, st2));
|
||||
QNetworkRequest request(url);
|
||||
|
||||
request.setRawHeader("Authorization",QString("GoogleLogin auth=%1").arg(s->getCookie()).toLatin1());
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ class Settings: public QObject
|
|||
Q_PROPERTY (int offsetLimit READ getOffsetLimit WRITE setOffsetLimit NOTIFY offsetLimitChanged)
|
||||
Q_PROPERTY (int viewMode READ getViewMode WRITE setViewMode NOTIFY viewModeChanged)
|
||||
Q_PROPERTY (bool helpDone READ getHelpDone WRITE setHelpDone NOTIFY helpDoneChanged)
|
||||
Q_PROPERTY (bool reinitDB READ getReinitDB WRITE setReinitDB)
|
||||
Q_PROPERTY (QString locale READ getLocale WRITE setLocale NOTIFY localeChanged)
|
||||
Q_PROPERTY (int fontSize READ getFontSize WRITE setFontSize NOTIFY fontSizeChanged)
|
||||
Q_PROPERTY (float zoom READ getZoom WRITE setZoom NOTIFY zoomChanged)
|
||||
|
|
|
|||
|
|
@ -66,6 +66,8 @@ void TabModel::createItems(const QString &dashboardId)
|
|||
if (s->getShowBroadcast()) {
|
||||
// Only for OldReader, Friends tab is first on the list
|
||||
insertRow(0,tab);
|
||||
} else {
|
||||
delete tab;
|
||||
}
|
||||
} else {
|
||||
appendRow(tab);
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ bool Utils::removeDir(const QString &dirName)
|
|||
|
||||
if (dir.exists(dirName)) {
|
||||
QFileInfoList infoList = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst);
|
||||
Q_FOREACH(QFileInfo info, infoList) {
|
||||
foreach (const QFileInfo& info, infoList) {
|
||||
if (info.isDir())
|
||||
result = removeDir(info.absoluteFilePath());
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue