Clang-format (#3028)

* 1/3 Add .clang-format file and travis compilation check

* 2/3 Run clang-format

* 3/3 Fix compilation problems due to include reordering

* 3bis/3 AfterControlStatement: false
This commit is contained in:
ctrlaltca 2018-01-27 10:41:32 +01:00 committed by GitHub
parent 8dbdd24c8e
commit b29bd9e070
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
272 changed files with 13378 additions and 9535 deletions

View file

@ -1,15 +1,15 @@
#ifndef SETTINGSCACHE_H
#define SETTINGSCACHE_H
#include "settings/carddatabasesettings.h"
#include "settings/gamefilterssettings.h"
#include "settings/layoutssettings.h"
#include "settings/messagesettings.h"
#include "settings/serverssettings.h"
#include "shortcutssettings.h"
#include <QObject>
#include <QSize>
#include <QStringList>
#include "shortcutssettings.h"
#include "settings/carddatabasesettings.h"
#include "settings/serverssettings.h"
#include "settings/messagesettings.h"
#include "settings/gamefilterssettings.h"
#include "settings/layoutssettings.h"
class ReleaseChannel;
@ -28,7 +28,8 @@ class ReleaseChannel;
class QSettings;
class SettingsCache : public QObject {
class SettingsCache : public QObject
{
Q_OBJECT
signals:
void langChanged();
@ -50,6 +51,7 @@ signals:
void chatMentionCompleterChanged();
void downloadSpoilerTimeIndexChanged();
void downloadSpoilerStatusChanged();
private:
QSettings *settings;
ShortcutsSettings *shortcutsSettings;
@ -62,7 +64,8 @@ private:
QByteArray mainWindowGeometry;
QByteArray tokenDialogGeometry;
QString lang;
QString deckPath, replaysPath, picsPath, customPicsPath, cardDatabasePath, customCardDatabasePath, spoilerDatabasePath, tokenDatabasePath, themeName;
QString deckPath, replaysPath, picsPath, customPicsPath, cardDatabasePath, customCardDatabasePath,
spoilerDatabasePath, tokenDatabasePath, themeName;
bool notifyAboutUpdates;
bool mbDownloadSpoilers;
int updateReleaseChannel;
@ -112,99 +115,318 @@ private:
bool spectatorsNeedPassword;
bool spectatorsCanTalk;
bool spectatorsCanSeeEverything;
int keepalive;
int keepalive;
void translateLegacySettings();
QString getSafeConfigPath(QString configEntry, QString defaultPath) const;
QString getSafeConfigFilePath(QString configEntry, QString defaultPath) const;
bool rememberGameSettings;
QList<ReleaseChannel*> releaseChannels;
QList<ReleaseChannel *> releaseChannels;
bool isPortableBuild;
public:
SettingsCache();
QString getDataPath();
QString getSettingsPath();
const QByteArray &getMainWindowGeometry() const { return mainWindowGeometry; }
const QByteArray &getTokenDialogGeometry() const { return tokenDialogGeometry; }
QString getLang() const { return lang; }
QString getDeckPath() const { return deckPath; }
QString getReplaysPath() const { return replaysPath; }
QString getPicsPath() const { return picsPath; }
QString getCustomPicsPath() const { return customPicsPath; }
QString getCustomCardDatabasePath() const { return customCardDatabasePath; }
QString getCardDatabasePath() const { return cardDatabasePath; }
QString getSpoilerCardDatabasePath() const { return spoilerDatabasePath; }
QString getTokenDatabasePath() const { return tokenDatabasePath; }
QString getThemeName() const { return themeName; }
QString getChatMentionColor() const { return chatMentionColor; }
QString getChatHighlightColor() const { return chatHighlightColor; }
bool getPicDownload() const { return picDownload; }
bool getNotificationsEnabled() const { return notificationsEnabled; }
bool getSpectatorNotificationsEnabled() const { return spectatorNotificationsEnabled; }
bool getNotifyAboutUpdates() const { return notifyAboutUpdates; }
ReleaseChannel * getUpdateReleaseChannel() const { return releaseChannels.at(updateReleaseChannel); }
QList<ReleaseChannel*> getUpdateReleaseChannels() const { return releaseChannels; }
const QByteArray &getMainWindowGeometry() const
{
return mainWindowGeometry;
}
const QByteArray &getTokenDialogGeometry() const
{
return tokenDialogGeometry;
}
QString getLang() const
{
return lang;
}
QString getDeckPath() const
{
return deckPath;
}
QString getReplaysPath() const
{
return replaysPath;
}
QString getPicsPath() const
{
return picsPath;
}
QString getCustomPicsPath() const
{
return customPicsPath;
}
QString getCustomCardDatabasePath() const
{
return customCardDatabasePath;
}
QString getCardDatabasePath() const
{
return cardDatabasePath;
}
QString getSpoilerCardDatabasePath() const
{
return spoilerDatabasePath;
}
QString getTokenDatabasePath() const
{
return tokenDatabasePath;
}
QString getThemeName() const
{
return themeName;
}
QString getChatMentionColor() const
{
return chatMentionColor;
}
QString getChatHighlightColor() const
{
return chatHighlightColor;
}
bool getPicDownload() const
{
return picDownload;
}
bool getNotificationsEnabled() const
{
return notificationsEnabled;
}
bool getSpectatorNotificationsEnabled() const
{
return spectatorNotificationsEnabled;
}
bool getNotifyAboutUpdates() const
{
return notifyAboutUpdates;
}
ReleaseChannel *getUpdateReleaseChannel() const
{
return releaseChannels.at(updateReleaseChannel);
}
QList<ReleaseChannel *> getUpdateReleaseChannels() const
{
return releaseChannels;
}
bool getDoubleClickToPlay() const { return doubleClickToPlay; }
bool getPlayToStack() const { return playToStack; }
bool getAnnotateTokens() const { return annotateTokens; }
QByteArray getTabGameSplitterSizes() const { return tabGameSplitterSizes; }
bool getDisplayCardNames() const { return displayCardNames; }
bool getHorizontalHand() const { return horizontalHand; }
bool getInvertVerticalCoordinate() const { return invertVerticalCoordinate; }
int getMinPlayersForMultiColumnLayout() const { return minPlayersForMultiColumnLayout; }
bool getTapAnimation() const { return tapAnimation; }
bool getChatMention() const { return chatMention; }
bool getChatMentionCompleter() const { return chatMentionCompleter; }
bool getChatMentionForeground() const { return chatMentionForeground; }
bool getChatHighlightForeground() const { return chatHighlightForeground; }
bool getZoneViewSortByName() const { return zoneViewSortByName; }
bool getZoneViewSortByType() const { return zoneViewSortByType; }
bool getDoubleClickToPlay() const
{
return doubleClickToPlay;
}
bool getPlayToStack() const
{
return playToStack;
}
bool getAnnotateTokens() const
{
return annotateTokens;
}
QByteArray getTabGameSplitterSizes() const
{
return tabGameSplitterSizes;
}
bool getDisplayCardNames() const
{
return displayCardNames;
}
bool getHorizontalHand() const
{
return horizontalHand;
}
bool getInvertVerticalCoordinate() const
{
return invertVerticalCoordinate;
}
int getMinPlayersForMultiColumnLayout() const
{
return minPlayersForMultiColumnLayout;
}
bool getTapAnimation() const
{
return tapAnimation;
}
bool getChatMention() const
{
return chatMention;
}
bool getChatMentionCompleter() const
{
return chatMentionCompleter;
}
bool getChatMentionForeground() const
{
return chatMentionForeground;
}
bool getChatHighlightForeground() const
{
return chatHighlightForeground;
}
bool getZoneViewSortByName() const
{
return zoneViewSortByName;
}
bool getZoneViewSortByType() const
{
return zoneViewSortByType;
}
/**
Returns if the view should be sorted into pile view.
@return zoneViewPileView if the view should be sorted into pile view.
*/
bool getZoneViewPileView() const { return zoneViewPileView; }
bool getSoundEnabled() const { return soundEnabled; }
QString getSoundThemeName() const { return soundThemeName; }
bool getIgnoreUnregisteredUsers() const { return ignoreUnregisteredUsers; }
bool getIgnoreUnregisteredUserMessages() const { return ignoreUnregisteredUserMessages; }
QString getPicUrl() const { return picUrl; }
QString getPicUrlFallback() const { return picUrlFallback; }
int getPixmapCacheSize() const { return pixmapCacheSize; }
bool getScaleCards() const { return scaleCards; }
bool getShowMessagePopup() const { return showMessagePopups; }
bool getShowMentionPopup() const { return showMentionPopups; }
bool getRoomHistory() const { return roomHistory; }
bool getLeftJustified() const { return leftJustified; }
int getMasterVolume() const { return masterVolume; }
int getCardInfoViewMode() const { return cardInfoViewMode; }
bool getZoneViewPileView() const
{
return zoneViewPileView;
}
bool getSoundEnabled() const
{
return soundEnabled;
}
QString getSoundThemeName() const
{
return soundThemeName;
}
bool getIgnoreUnregisteredUsers() const
{
return ignoreUnregisteredUsers;
}
bool getIgnoreUnregisteredUserMessages() const
{
return ignoreUnregisteredUserMessages;
}
QString getPicUrl() const
{
return picUrl;
}
QString getPicUrlFallback() const
{
return picUrlFallback;
}
int getPixmapCacheSize() const
{
return pixmapCacheSize;
}
bool getScaleCards() const
{
return scaleCards;
}
bool getShowMessagePopup() const
{
return showMessagePopups;
}
bool getShowMentionPopup() const
{
return showMentionPopups;
}
bool getRoomHistory() const
{
return roomHistory;
}
bool getLeftJustified() const
{
return leftJustified;
}
int getMasterVolume() const
{
return masterVolume;
}
int getCardInfoViewMode() const
{
return cardInfoViewMode;
}
QStringList getCountries() const;
QString getHighlightWords() const { return highlightWords; }
QString getGameDescription() const { return gameDescription; }
int getMaxPlayers() const { return maxPlayers; }
QString getGameTypes() const { return gameTypes; }
bool getOnlyBuddies() const { return onlyBuddies; }
bool getOnlyRegistered() const { return onlyRegistered; }
bool getSpectatorsAllowed() const { return spectatorsAllowed; }
bool getSpectatorsNeedPassword() const { return spectatorsNeedPassword; }
bool getSpectatorsCanTalk() const { return spectatorsCanTalk; }
bool getSpectatorsCanSeeEverything() const { return spectatorsCanSeeEverything; }
bool getRememberGameSettings() const { return rememberGameSettings; }
int getKeepAlive() const { return keepalive; }
int getMaxFontSize() const { return maxFontSize; }
QString getHighlightWords() const
{
return highlightWords;
}
QString getGameDescription() const
{
return gameDescription;
}
int getMaxPlayers() const
{
return maxPlayers;
}
QString getGameTypes() const
{
return gameTypes;
}
bool getOnlyBuddies() const
{
return onlyBuddies;
}
bool getOnlyRegistered() const
{
return onlyRegistered;
}
bool getSpectatorsAllowed() const
{
return spectatorsAllowed;
}
bool getSpectatorsNeedPassword() const
{
return spectatorsNeedPassword;
}
bool getSpectatorsCanTalk() const
{
return spectatorsCanTalk;
}
bool getSpectatorsCanSeeEverything() const
{
return spectatorsCanSeeEverything;
}
bool getRememberGameSettings() const
{
return rememberGameSettings;
}
int getKeepAlive() const
{
return keepalive;
}
int getMaxFontSize() const
{
return maxFontSize;
}
void setClientID(QString clientID);
void setKnownMissingFeatures(QString _knownMissingFeatures);
QString getClientID() { return clientID; }
QString getKnownMissingFeatures() { return knownMissingFeatures; }
ShortcutsSettings& shortcuts() const { return *shortcutsSettings; }
CardDatabaseSettings& cardDatabase() const { return *cardDatabaseSettings; }
ServersSettings& servers() const { return *serversSettings; }
MessageSettings& messages() const { return *messageSettings; }
GameFiltersSettings& gameFilters() const { return *gameFiltersSettings; }
LayoutsSettings& layouts() const { return *layoutsSettings; }
bool getIsPortableBuild() const { return isPortableBuild; }
bool getDownloadSpoilersStatus() const { return mbDownloadSpoilers; }
QString getClientID()
{
return clientID;
}
QString getKnownMissingFeatures()
{
return knownMissingFeatures;
}
ShortcutsSettings &shortcuts() const
{
return *shortcutsSettings;
}
CardDatabaseSettings &cardDatabase() const
{
return *cardDatabaseSettings;
}
ServersSettings &servers() const
{
return *serversSettings;
}
MessageSettings &messages() const
{
return *messageSettings;
}
GameFiltersSettings &gameFilters() const
{
return *gameFiltersSettings;
}
LayoutsSettings &layouts() const
{
return *layoutsSettings;
}
bool getIsPortableBuild() const
{
return isPortableBuild;
}
bool getDownloadSpoilersStatus() const
{
return mbDownloadSpoilers;
}
public slots:
void setDownloadSpoilerStatus(bool _spoilerStatus);
@ -250,7 +472,7 @@ public slots:
void setShowMessagePopups(const int _showMessagePopups);
void setShowMentionPopups(const int _showMentionPopups);
void setRoomHistory(const int _roomHistory);
void setLeftJustified( const int _leftJustified);
void setLeftJustified(const int _leftJustified);
void setMasterVolume(const int _masterVolume);
void setCardInfoViewMode(const int _viewMode);
void setHighlightWords(const QString &_highlightWords);