Formatting
This commit is contained in:
@@ -105,7 +105,7 @@ class Database : public QObject {
|
||||
QStringList SongsTables(QSqlDatabase &db, int schema_version) const;
|
||||
bool IntegrityCheck(const QSqlDatabase &db);
|
||||
void BackupFile(const QString &filename);
|
||||
static bool OpenDatabase(const QString &filename, sqlite3 **connection) ;
|
||||
static bool OpenDatabase(const QString &filename, sqlite3 **connection);
|
||||
|
||||
Application *app_;
|
||||
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
|
||||
#include "filesystemmusicstorage.h"
|
||||
|
||||
FilesystemMusicStorage::FilesystemMusicStorage(const QString &root)
|
||||
: root_(root) {}
|
||||
FilesystemMusicStorage::FilesystemMusicStorage(const QString &root) : root_(root) {}
|
||||
|
||||
bool FilesystemMusicStorage::CopyToStorage(const CopyJob &job) {
|
||||
|
||||
|
||||
@@ -43,4 +43,4 @@ class FilesystemMusicStorage : public virtual MusicStorage {
|
||||
Q_DISABLE_COPY(FilesystemMusicStorage)
|
||||
};
|
||||
|
||||
#endif // FILESYSTEMMUSICSTORAGE_H
|
||||
#endif // FILESYSTEMMUSICSTORAGE_H
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "qtfslistener.h"
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
#include "macfslistener.h"
|
||||
# include "macfslistener.h"
|
||||
#endif
|
||||
|
||||
FileSystemWatcherInterface::FileSystemWatcherInterface(QObject *parent)
|
||||
|
||||
@@ -62,8 +62,12 @@ QIcon IconLoader::Load(const QString &name, const int fixed_size, const int min_
|
||||
}
|
||||
|
||||
QList<int> sizes;
|
||||
if (fixed_size == 0) { sizes << 22 << 32 << 48 << 64; }
|
||||
else sizes << fixed_size;
|
||||
if (fixed_size == 0) {
|
||||
sizes << 22 << 32 << 48 << 64;
|
||||
}
|
||||
else {
|
||||
sizes << fixed_size;
|
||||
}
|
||||
|
||||
if (system_icons_) {
|
||||
IconMapper::IconProperties icon_prop;
|
||||
|
||||
@@ -134,4 +134,4 @@ static const QMap<QString, IconProperties> iconmapper_ = { // clazy:exclude=non
|
||||
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace IconMapper
|
||||
|
||||
@@ -36,7 +36,8 @@ namespace mac {
|
||||
|
||||
QKeySequence KeySequenceFromNSEvent(NSEvent *event);
|
||||
void DumpDictionary(CFDictionaryRef dict);
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
|
||||
namespace Utilities {
|
||||
qint32 GetMacOsVersion();
|
||||
|
||||
@@ -609,8 +609,8 @@ MainWindow::MainWindow(Application *app, std::shared_ptr<SystemTrayIcon> tray_ic
|
||||
QObject::connect(collection_view_->view(), &CollectionView::Error, this, &MainWindow::ShowErrorDialog);
|
||||
QObject::connect(app_->collection_model(), &CollectionModel::TotalSongCountUpdated, collection_view_->view(), &CollectionView::TotalSongCountUpdated);
|
||||
QObject::connect(app_->collection_model(), &CollectionModel::TotalArtistCountUpdated, collection_view_->view(), &CollectionView::TotalArtistCountUpdated);
|
||||
QObject::connect(app_->collection_model(), &CollectionModel::TotalAlbumCountUpdated, collection_view_->view(), &CollectionView::TotalAlbumCountUpdated);
|
||||
QObject::connect(app_->collection_model(), &CollectionModel::modelAboutToBeReset, collection_view_->view(), &CollectionView::SaveFocus);
|
||||
QObject::connect(app_->collection_model(), &CollectionModel::TotalAlbumCountUpdated, collection_view_->view(), &CollectionView::TotalAlbumCountUpdated);
|
||||
QObject::connect(app_->collection_model(), &CollectionModel::modelAboutToBeReset, collection_view_->view(), &CollectionView::SaveFocus);
|
||||
QObject::connect(app_->collection_model(), &CollectionModel::modelReset, collection_view_->view(), &CollectionView::RestoreFocus);
|
||||
|
||||
QObject::connect(app_->task_manager(), &TaskManager::PauseCollectionWatchers, app_->collection(), &SCollection::PauseWatcher);
|
||||
@@ -917,7 +917,7 @@ MainWindow::MainWindow(Application *app, std::shared_ptr<SystemTrayIcon> tray_ic
|
||||
// Reload playlist settings, for BG and glowing
|
||||
ui_->playlist->view()->ReloadSettings();
|
||||
|
||||
#ifdef Q_OS_MACOS // Always show the mainwindow on startup for macOS
|
||||
#ifdef Q_OS_MACOS // Always show the mainwindow on startup for macOS
|
||||
show();
|
||||
#else
|
||||
QSettings s;
|
||||
@@ -1198,7 +1198,7 @@ void MainWindow::Exit() {
|
||||
if (tray_icon_->IsSystemTrayAvailable()) {
|
||||
tray_icon_->setVisible(false);
|
||||
}
|
||||
return; // Don't quit the application now: wait for the fadeout finished signal
|
||||
return; // Don't quit the application now: wait for the fadeout finished signal
|
||||
}
|
||||
}
|
||||
DoExit();
|
||||
@@ -1427,7 +1427,7 @@ void MainWindow::LoadPlaybackStatus() {
|
||||
s.endGroup();
|
||||
|
||||
s.beginGroup(Player::kSettingsGroup);
|
||||
Engine::State playback_state = static_cast<Engine::State> (s.value("playback_state", Engine::Empty).toInt());
|
||||
Engine::State playback_state = static_cast<Engine::State>(s.value("playback_state", Engine::Empty).toInt());
|
||||
s.endGroup();
|
||||
|
||||
if (resume_playback && playback_state != Engine::Empty && playback_state != Engine::Idle) {
|
||||
@@ -1444,7 +1444,7 @@ void MainWindow::ResumePlayback() {
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(Player::kSettingsGroup);
|
||||
Engine::State playback_state = static_cast<Engine::State> (s.value("playback_state", Engine::Empty).toInt());
|
||||
Engine::State playback_state = static_cast<Engine::State>(s.value("playback_state", Engine::Empty).toInt());
|
||||
int playback_playlist = s.value("playback_playlist", -1).toInt();
|
||||
int playback_position = s.value("playback_position", 0).toInt();
|
||||
s.endGroup();
|
||||
@@ -1589,9 +1589,15 @@ void MainWindow::SetHiddenInTray(const bool hidden) {
|
||||
hide();
|
||||
}
|
||||
else {
|
||||
if (was_minimized_) { showMinimized(); }
|
||||
else if (was_maximized_) showMaximized();
|
||||
else show();
|
||||
if (was_minimized_) {
|
||||
showMinimized();
|
||||
}
|
||||
else if (was_maximized_) {
|
||||
showMaximized();
|
||||
}
|
||||
else {
|
||||
show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1649,7 +1655,7 @@ void MainWindow::UpdateTrackSliderPosition() {
|
||||
void MainWindow::ApplyAddBehaviour(const BehaviourSettingsPage::AddBehaviour b, MimeData *mimedata) {
|
||||
|
||||
switch (b) {
|
||||
case BehaviourSettingsPage::AddBehaviour_Append:
|
||||
case BehaviourSettingsPage::AddBehaviour_Append:
|
||||
mimedata->clear_first_ = false;
|
||||
mimedata->enqueue_now_ = false;
|
||||
break;
|
||||
@@ -1942,7 +1948,7 @@ void MainWindow::PlaylistRightClick(const QPoint global_pos, const QModelIndex &
|
||||
// Get the new item actions, and add them
|
||||
playlistitem_actions_ = item->actions();
|
||||
playlistitem_actions_separator_->setVisible(!playlistitem_actions_.isEmpty());
|
||||
playlist_menu_->insertActions(playlistitem_actions_separator_,playlistitem_actions_);
|
||||
playlist_menu_->insertActions(playlistitem_actions_separator_, playlistitem_actions_);
|
||||
}
|
||||
|
||||
//if it isn't the first time we right click, we need to remove the menu previously created
|
||||
@@ -2094,7 +2100,7 @@ void MainWindow::RenumberTracks() {
|
||||
void MainWindow::SongSaveComplete(TagReaderReply *reply, const QPersistentModelIndex &idx) {
|
||||
|
||||
if (reply->is_successful() && idx.isValid()) {
|
||||
app_->playlist_manager()->current()->ReloadItems(QList<int>()<< idx.row());
|
||||
app_->playlist_manager()->current()->ReloadItems(QList<int>() << idx.row());
|
||||
}
|
||||
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
|
||||
|
||||
@@ -2247,11 +2253,11 @@ void MainWindow::PlaylistClearCurrent() {
|
||||
messagebox.setTextFormat(Qt::RichText);
|
||||
int result = messagebox.exec();
|
||||
switch (result) {
|
||||
case QMessageBox::Ok:
|
||||
break;
|
||||
case QMessageBox::Cancel:
|
||||
default:
|
||||
return;
|
||||
case QMessageBox::Ok:
|
||||
break;
|
||||
case QMessageBox::Cancel:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2818,7 +2824,7 @@ void MainWindow::CheckFullRescanRevisions() {
|
||||
// if we have any...
|
||||
if (!reasons.isEmpty()) {
|
||||
QString message = tr("The version of Strawberry you've just updated to requires a full collection rescan because of the new features listed below:") + "<ul>";
|
||||
for(const QString &reason : reasons) {
|
||||
for (const QString &reason : reasons) {
|
||||
message += ("<li>" + reason + "</li>");
|
||||
}
|
||||
message += "</ul>" + tr("Would you like to run a full rescan right now?");
|
||||
@@ -3082,7 +3088,7 @@ void MainWindow::SetToggleScrobblingIcon(const bool value) {
|
||||
if (app_->playlist_manager()->active() && app_->playlist_manager()->active()->scrobbled())
|
||||
ui_->action_toggle_scrobbling->setIcon(IconLoader::Load("scrobble", 22));
|
||||
else
|
||||
ui_->action_toggle_scrobbling->setIcon(IconLoader::Load("scrobble", 22)); // TODO: Create a faint version of the icon
|
||||
ui_->action_toggle_scrobbling->setIcon(IconLoader::Load("scrobble", 22)); // TODO: Create a faint version of the icon
|
||||
}
|
||||
else {
|
||||
ui_->action_toggle_scrobbling->setIcon(IconLoader::Load("scrobble-disabled", 22));
|
||||
|
||||
@@ -280,7 +280,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
||||
|
||||
void SaveSettings();
|
||||
|
||||
static void ApplyAddBehaviour(const BehaviourSettingsPage::AddBehaviour b, MimeData *mimedata) ;
|
||||
static void ApplyAddBehaviour(const BehaviourSettingsPage::AddBehaviour b, MimeData *mimedata);
|
||||
void ApplyPlayBehaviour(const BehaviourSettingsPage::PlayBehaviour b, MimeData *mimedata) const;
|
||||
|
||||
void CheckFullRescanRevisions();
|
||||
|
||||
@@ -84,7 +84,7 @@ void RegisterMetaTypes() {
|
||||
qRegisterMetaType<QAbstractSocket::SocketState>();
|
||||
qRegisterMetaType<QAbstractSocket::SocketState>("QAbstractSocket::SocketState");
|
||||
qRegisterMetaType<QNetworkCookie>("QNetworkCookie");
|
||||
qRegisterMetaType<QList<QNetworkCookie> >("QList<QNetworkCookie>");
|
||||
qRegisterMetaType<QList<QNetworkCookie>>("QList<QNetworkCookie>");
|
||||
qRegisterMetaType<QNetworkReply*>("QNetworkReply*");
|
||||
qRegisterMetaType<QNetworkReply**>("QNetworkReply**");
|
||||
qRegisterMetaType<QItemSelection>("QItemSelection");
|
||||
@@ -99,7 +99,7 @@ void RegisterMetaTypes() {
|
||||
qRegisterMetaType<Subdirectory>("Subdirectory");
|
||||
qRegisterMetaType<SubdirectoryList>("SubdirectoryList");
|
||||
qRegisterMetaType<Song>("Song");
|
||||
qRegisterMetaType<QList<Song> >("QList<Song>");
|
||||
qRegisterMetaType<QList<Song>>("QList<Song>");
|
||||
qRegisterMetaType<SongList>("SongList");
|
||||
qRegisterMetaType<Engine::EngineType>("EngineType");
|
||||
qRegisterMetaType<Engine::SimpleMetaBundle>("Engine::SimpleMetaBundle");
|
||||
@@ -113,14 +113,14 @@ void RegisterMetaTypes() {
|
||||
#endif
|
||||
qRegisterMetaType<PlaylistItemList>("PlaylistItemList");
|
||||
qRegisterMetaType<PlaylistItemPtr>("PlaylistItemPtr");
|
||||
qRegisterMetaType<QList<PlaylistItemPtr> >("QList<PlaylistItemPtr>");
|
||||
qRegisterMetaType<QList<PlaylistItemPtr>>("QList<PlaylistItemPtr>");
|
||||
qRegisterMetaType<PlaylistSequence::RepeatMode>("PlaylistSequence::RepeatMode");
|
||||
qRegisterMetaType<PlaylistSequence::ShuffleMode>("PlaylistSequence::ShuffleMode");
|
||||
qRegisterMetaType<AlbumCoverLoaderResult>("AlbumCoverLoaderResult");
|
||||
qRegisterMetaType<AlbumCoverLoaderResult::Type>("AlbumCoverLoaderResult::Type");
|
||||
qRegisterMetaType<CoverProviderSearchResult>("CoverProviderSearchResult");
|
||||
qRegisterMetaType<CoverSearchStatistics>("CoverSearchStatistics");
|
||||
qRegisterMetaType<QList<CoverProviderSearchResult> >("QList<CoverProviderSearchResult>");
|
||||
qRegisterMetaType<QList<CoverProviderSearchResult>>("QList<CoverProviderSearchResult>");
|
||||
qRegisterMetaType<CoverProviderSearchResults>("CoverProviderSearchResults");
|
||||
qRegisterMetaType<Equalizer::Params>("Equalizer::Params");
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
|
||||
@@ -101,9 +101,9 @@ const char *Mpris2::kServiceName = "org.mpris.MediaPlayer2.strawberry";
|
||||
const char *Mpris2::kFreedesktopPath = "org.freedesktop.DBus.Properties";
|
||||
|
||||
Mpris2::Mpris2(Application *app, QObject *parent)
|
||||
: QObject(parent),
|
||||
app_(app),
|
||||
app_name_(QCoreApplication::applicationName()) {
|
||||
: QObject(parent),
|
||||
app_(app),
|
||||
app_name_(QCoreApplication::applicationName()) {
|
||||
|
||||
new Mpris2Root(this);
|
||||
new Mpris2TrackList(this);
|
||||
@@ -491,7 +491,7 @@ void Mpris2::SetPosition(const QDBusObjectPath &trackId, qint64 offset) {
|
||||
if (CanSeek() && trackId.path() == current_track_id() && offset >= 0) {
|
||||
offset *= kNsecPerUsec;
|
||||
|
||||
if(offset < app_->player()->GetCurrentItem()->Metadata().length_nanosec()) {
|
||||
if (offset < app_->player()->GetCurrentItem()->Metadata().length_nanosec()) {
|
||||
app_->player()->SeekTo(offset / kNsecPerSec);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ struct MaybePlaylist {
|
||||
Q_DECLARE_METATYPE(MaybePlaylist)
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &arg, const MprisPlaylist &playlist);
|
||||
const QDBusArgument &operator>> (const QDBusArgument &arg, MprisPlaylist &playlist);
|
||||
const QDBusArgument &operator>>(const QDBusArgument &arg, MprisPlaylist &playlist);
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &arg, const MaybePlaylist &playlist);
|
||||
const QDBusArgument &operator>> (const QDBusArgument &arg, MaybePlaylist &playlist);
|
||||
const QDBusArgument &operator>>(const QDBusArgument &arg, MaybePlaylist &playlist);
|
||||
|
||||
namespace mpris {
|
||||
|
||||
@@ -172,7 +172,7 @@ class Mpris2 : public QObject {
|
||||
static bool CanEditTracks();
|
||||
|
||||
// Methods
|
||||
static TrackMetadata GetTracksMetadata(const Track_Ids &tracks) ;
|
||||
static TrackMetadata GetTracksMetadata(const Track_Ids &tracks);
|
||||
static void AddTrack(const QString &uri, const QDBusObjectPath &afterTrack, bool setAsCurrent);
|
||||
static void RemoveTrack(const QDBusObjectPath &trackId);
|
||||
static void GoTo(const QDBusObjectPath &trackId);
|
||||
@@ -218,7 +218,7 @@ class Mpris2 : public QObject {
|
||||
static void EmitNotification(const QString &name, const QVariant &val);
|
||||
static void EmitNotification(const QString &name, const QVariant &val, const QString &mprisEntity);
|
||||
|
||||
static QString PlaybackStatus(Engine::State state) ;
|
||||
static QString PlaybackStatus(Engine::State state);
|
||||
|
||||
QString current_track_id() const;
|
||||
|
||||
|
||||
@@ -59,6 +59,6 @@ inline QString AsMPRISDateTimeType(const qint64 time) {
|
||||
return time != -1 ? QDateTime::fromSecsSinceEpoch(time).toString(Qt::ISODate) : "";
|
||||
}
|
||||
|
||||
} // namespace mpris
|
||||
} // namespace mpris
|
||||
|
||||
#endif // MPRIS_COMMON_H
|
||||
|
||||
@@ -56,7 +56,7 @@ bool MultiSortFilterProxy::lessThan(const QModelIndex &left, const QModelIndex &
|
||||
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
static inline int DoCompare(T left, T right) {
|
||||
|
||||
if (left < right) return -1;
|
||||
|
||||
@@ -140,7 +140,7 @@ class Player : public PlayerInterface {
|
||||
void Init();
|
||||
|
||||
EngineBase *engine() const override { return engine_.get(); }
|
||||
Engine::State GetState() const override{ return last_state_; }
|
||||
Engine::State GetState() const override { return last_state_; }
|
||||
int GetVolume() const override;
|
||||
|
||||
PlaylistItemPtr GetCurrentItem() const override { return current_item_; }
|
||||
|
||||
@@ -988,8 +988,8 @@ void Song::InitFromQuery(const SqlRow &q, bool reliable_metadata, int col) {
|
||||
d->directory_id_ = toint(x);
|
||||
}
|
||||
else if (Song::kColumns.value(i) == "url") {
|
||||
set_url(QUrl::fromEncoded(tostr(x).toUtf8()));
|
||||
d->basefilename_ = QFileInfo(d->url_.toLocalFile()).fileName();
|
||||
set_url(QUrl::fromEncoded(tostr(x).toUtf8()));
|
||||
d->basefilename_ = QFileInfo(d->url_.toLocalFile()).fileName();
|
||||
}
|
||||
else if (Song::kColumns.value(i) == "filetype") {
|
||||
d->filetype_ = FileType(q.value(x).toInt());
|
||||
|
||||
@@ -391,7 +391,7 @@ class Song {
|
||||
private:
|
||||
struct Private;
|
||||
|
||||
static QString sortable(const QString &v) ;
|
||||
static QString sortable(const QString &v);
|
||||
|
||||
QSharedDataPointer<Private> d;
|
||||
};
|
||||
|
||||
@@ -252,8 +252,7 @@ SongLoader::Result SongLoader::LoadLocal(const QString &filename) {
|
||||
if (song.is_valid()) {
|
||||
songs_ << song;
|
||||
}
|
||||
}
|
||||
while (query.Next());
|
||||
} while (query.Next());
|
||||
|
||||
return Success;
|
||||
}
|
||||
@@ -294,7 +293,7 @@ SongLoader::Result SongLoader::LoadLocalAsync(const QString &filename) {
|
||||
parser = playlist_parser_->ParserForExtension(fileinfo.suffix().toLower());
|
||||
}
|
||||
|
||||
if (parser) { // It's a playlist!
|
||||
if (parser) { // It's a playlist!
|
||||
qLog(Debug) << "Parsing using" << parser->name();
|
||||
LoadPlaylist(parser, filename);
|
||||
return Success;
|
||||
|
||||
@@ -80,7 +80,7 @@ void StandardItemIconLoader::RowsAboutToBeRemoved(const QModelIndex &parent, int
|
||||
it = pending_covers_.erase(it); // clazy:exclude=strict-iterators
|
||||
}
|
||||
else {
|
||||
++ it;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ namespace Utils {
|
||||
|
||||
QColor StyleHelper::m_baseColor;
|
||||
QColor StyleHelper::m_requestedBaseColor;
|
||||
QColor StyleHelper::m_IconsBaseColor=0xffdcdcdc;
|
||||
QColor StyleHelper::m_IconsDisabledColor=0x88a0a0a0;
|
||||
QColor StyleHelper::m_IconsBaseColor = 0xffdcdcdc;
|
||||
QColor StyleHelper::m_IconsDisabledColor = 0x88a0a0a0;
|
||||
QColor StyleHelper::m_ProgressBarTitleColor = 0xffffffff;
|
||||
|
||||
QColor StyleHelper::mergedColors(const QColor &colorA, const QColor &colorB, int factor) {
|
||||
@@ -168,7 +168,7 @@ void StyleHelper::setBaseColor(const QColor &newcolor) {
|
||||
|
||||
if (color.isValid() && color != m_baseColor) {
|
||||
m_baseColor = color;
|
||||
for (QWidget* w : QApplication::topLevelWidgets()) {
|
||||
for (QWidget *w : QApplication::topLevelWidgets()) {
|
||||
w->update();
|
||||
}
|
||||
}
|
||||
@@ -324,8 +324,8 @@ void StyleHelper::drawArrow(QStyle::PrimitiveElement element, QPainter *painter,
|
||||
pixmap.setDevicePixelRatio(devicePixelRatio);
|
||||
QPixmapCache::insert(pixmapName, pixmap);
|
||||
}
|
||||
int xOffset = r.x() + (r.width() - size)/2;
|
||||
int yOffset = r.y() + (r.height() - size)/2;
|
||||
int xOffset = r.x() + (r.width() - size) / 2;
|
||||
int yOffset = r.y() + (r.height() - size) / 2;
|
||||
painter->drawPixmap(xOffset, yOffset, pixmap);
|
||||
|
||||
}
|
||||
@@ -356,7 +356,7 @@ QPixmap StyleHelper::disabledSideBarIcon(const QPixmap &enabledicon) {
|
||||
|
||||
QImage im = enabledicon.toImage().convertToFormat(QImage::Format_ARGB32);
|
||||
|
||||
for (int y=0; y<im.height(); ++y) {
|
||||
for (int y = 0; y < im.height(); ++y) {
|
||||
auto scanLine = reinterpret_cast<QRgb*>(im.scanLine(y));
|
||||
for (int x=0; x<im.width(); ++x) {
|
||||
QRgb pixel = *scanLine;
|
||||
|
||||
@@ -35,7 +35,7 @@ class QTimer;
|
||||
class QEvent;
|
||||
|
||||
class StyleSheetLoader : public QObject {
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StyleSheetLoader(QObject *parent = nullptr);
|
||||
|
||||
@@ -35,7 +35,7 @@ class QIODevice;
|
||||
class QNetworkDiskCache;
|
||||
|
||||
class ThreadSafeNetworkDiskCache : public QAbstractNetworkCache {
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ThreadSafeNetworkDiskCache(QObject *parent);
|
||||
|
||||
@@ -220,7 +220,7 @@ quint64 FileSystemCapacity(const QString &path) {
|
||||
quint64 FileSystemFreeSpace(const QString &path) {
|
||||
|
||||
#if defined(Q_OS_UNIX)
|
||||
struct statvfs fs_info{};
|
||||
struct statvfs fs_info {};
|
||||
if (statvfs(path.toLocal8Bit().constData(), &fs_info) == 0)
|
||||
return quint64(fs_info.f_bavail) * quint64(fs_info.f_bsize);
|
||||
#elif defined(Q_OS_WIN32)
|
||||
@@ -447,11 +447,11 @@ void OpenInFileBrowser(const QList<QUrl> &urls) {
|
||||
messagebox.setTextFormat(Qt::RichText);
|
||||
int result = messagebox.exec();
|
||||
switch (result) {
|
||||
case QMessageBox::Open:
|
||||
break;
|
||||
case QMessageBox::Cancel:
|
||||
default:
|
||||
return;
|
||||
case QMessageBox::Open:
|
||||
break;
|
||||
case QMessageBox::Cancel:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ void ConsumeCurrentElement(QXmlStreamReader *reader) {
|
||||
while (level != 0 && !reader->atEnd()) {
|
||||
switch (reader->readNext()) {
|
||||
case QXmlStreamReader::StartElement: ++level; break;
|
||||
case QXmlStreamReader::EndElement: --level; break;
|
||||
case QXmlStreamReader::EndElement: --level; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@@ -735,17 +735,18 @@ QString CryptographicRandomString(const int len) {
|
||||
|
||||
QString GetRandomString(const int len, const QString &UseCharacters) {
|
||||
|
||||
QString randstr;
|
||||
for(int i = 0 ; i < len ; ++i) {
|
||||
QString randstr;
|
||||
for (int i = 0 ; i < len ; ++i) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||
const int index = QRandomGenerator::global()->bounded(0, UseCharacters.length());
|
||||
const int index = QRandomGenerator::global()->bounded(0, UseCharacters.length());
|
||||
#else
|
||||
const int index = qrand() % UseCharacters.length();
|
||||
const int index = qrand() % UseCharacters.length();
|
||||
#endif
|
||||
QChar nextchar = UseCharacters.at(index);
|
||||
randstr.append(nextchar);
|
||||
}
|
||||
return randstr;
|
||||
QChar nextchar = UseCharacters.at(index);
|
||||
randstr.append(nextchar);
|
||||
}
|
||||
|
||||
return randstr;
|
||||
|
||||
}
|
||||
|
||||
@@ -916,7 +917,7 @@ QString ReplaceVariable(const QString &variable, const Song &song, const QString
|
||||
value = song.PrettyRating();
|
||||
}
|
||||
else if (variable == "%newline%") {
|
||||
return QString(newline); // No HTML escaping, return immediately.
|
||||
return QString(newline); // No HTML escaping, return immediately.
|
||||
}
|
||||
|
||||
if (html_escaped) {
|
||||
|
||||
@@ -148,7 +148,7 @@ QString MimeTypeFromData(const QByteArray &data);
|
||||
void enableBlurBehindWindow(QWindow *window, const QRegion ®ion);
|
||||
#endif
|
||||
|
||||
} // namespace
|
||||
} // namespace Utilities
|
||||
|
||||
class ScopedWCharArray {
|
||||
public:
|
||||
|
||||
@@ -150,7 +150,7 @@ void Windows7ThumbBar::HandleWinEvent(MSG *msg) {
|
||||
|
||||
for (int i = 0 ; i < actions_.count() ; ++i) {
|
||||
if (buttons[i].hIcon) {
|
||||
DestroyIcon (buttons[i].hIcon);
|
||||
DestroyIcon(buttons[i].hIcon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user