Reindentation and code style update

This commit is contained in:
ArsenArsen 2017-10-05 19:21:52 +02:00
parent a3bd380733
commit 3e6a3b0407
No known key found for this signature in database
GPG Key ID: 683D2F43B0CA4BD2
19 changed files with 88 additions and 84 deletions

View File

@ -1,3 +1,4 @@
# vim: set syntax=yaml :
AccessModifierOffset: -4 AccessModifierOffset: -4
AlignEscapedNewlinesLeft: false AlignEscapedNewlinesLeft: false
AlignTrailingComments: true AlignTrailingComments: true
@ -24,7 +25,7 @@ IndentFunctionDeclarationAfterType: false
IndentWidth: 4 IndentWidth: 4
Language: Cpp Language: Cpp
MaxEmptyLinesToKeep: 2 MaxEmptyLinesToKeep: 2
NamespaceIndentation: None NamespaceIndentation: All
ObjCSpaceAfterProperty: true ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 100 PenaltyBreakBeforeFirstCallParameter: 100

View File

@ -4,7 +4,7 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class AboutBox; class AboutBox;
} }
class AboutBox : public QDialog { class AboutBox : public QDialog {

View File

@ -5,7 +5,7 @@
#include <cropeditor/cropscene.hpp> #include <cropeditor/cropscene.hpp>
namespace Ui { namespace Ui {
class BrushPenSelection; class BrushPenSelection;
} }
class BrushPenSelection : public QDialog { class BrushPenSelection : public QDialog {

View File

@ -4,14 +4,14 @@
#include <QString> #include <QString>
namespace formats { namespace formats {
enum class Normal { PNG, JPG, None }; enum class Normal { PNG, JPG, None };
QString normalFormatName(Normal format); QString normalFormatName(Normal format);
Normal normalFormatFromName(QString format); Normal normalFormatFromName(QString format);
QString normalFormatMIME(Normal format); QString normalFormatMIME(Normal format);
enum class Recording { GIF, WebM, MP4, None }; enum class Recording { GIF, WebM, MP4, None };
QString recordingFormatName(Recording format); QString recordingFormatName(Recording format);
Recording recordingFormatFromName(QString format); Recording recordingFormatFromName(QString format);
QString recordingFormatMIME(Recording format); QString recordingFormatMIME(Recording format);
} }
#endif // FORMATS_HPP #endif // FORMATS_HPP

View File

@ -6,7 +6,7 @@
#include <QString> #include <QString>
namespace formatter { namespace formatter {
QString format(QString toFormat, QString ext, QMap<QString, QString> variables = QMap<QString, QString>()); QString format(QString toFormat, QString ext, QMap<QString, QString> variables = QMap<QString, QString>());
} }
#endif // FORMATTER_HPP #endif // FORMATTER_HPP

View File

@ -6,10 +6,10 @@
#include <functional> #include <functional>
namespace hotkeying { namespace hotkeying {
void hotkey(QString seqName, QKeySequence seq, std::function<void()> func); void hotkey(QString seqName, QKeySequence seq, std::function<void()> func);
bool valid(QString seq); bool valid(QString seq);
void load(QString seqName, std::function<void()> func, QString def = QString()); void load(QString seqName, std::function<void()> func, QString def = QString());
QString sequence(QString seqName); QString sequence(QString seqName);
} }
#endif // HOTKEYING_HPP #endif // HOTKEYING_HPP

View File

@ -4,7 +4,7 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class HotkeyInputDialog; class HotkeyInputDialog;
} }
class HotkeyInputDialog : public QDialog { class HotkeyInputDialog : public QDialog {

View File

@ -8,23 +8,25 @@
#include <functional> #include <functional>
namespace ioutils { namespace ioutils {
extern QNetworkAccessManager networkManager; extern QNetworkAccessManager networkManager;
void getJson(QUrl target, QList<QPair<QString, QString>> headers, std::function<void(QJsonDocument, QByteArray, QNetworkReply *)> callback); void getJson(QUrl target,
void postJson(QUrl target, QList<QPair<QString, QString>> headers,
std::function<void(QJsonDocument, QByteArray, QNetworkReply *)> callback);
void postJson(QUrl target,
QList<QPair<QString, QString>> headers, QList<QPair<QString, QString>> headers,
QByteArray body, QByteArray body,
std::function<void(QJsonDocument, QByteArray, QNetworkReply *)> callback); std::function<void(QJsonDocument, QByteArray, QNetworkReply *)> callback);
void getData(QUrl target, QList<QPair<QString, QString>> headers, std::function<void(QByteArray, QNetworkReply *)> callback); void getData(QUrl target, QList<QPair<QString, QString>> headers, std::function<void(QByteArray, QNetworkReply *)> callback);
void postData(QUrl target, QList<QPair<QString, QString>> headers, QByteArray body, std::function<void(QByteArray, QNetworkReply *)> callback); void postData(QUrl target, QList<QPair<QString, QString>> headers, QByteArray body, std::function<void(QByteArray, QNetworkReply *)> callback);
void postMultipart(QUrl target, void postMultipart(QUrl target,
QList<QPair<QString, QString>> headers, QList<QPair<QString, QString>> headers,
QHttpMultiPart *body, QHttpMultiPart *body,
std::function<void(QJsonDocument, QByteArray, QNetworkReply *)> callback); std::function<void(QJsonDocument, QByteArray, QNetworkReply *)> callback);
void postMultipartData(QUrl target, void postMultipartData(QUrl target,
QList<QPair<QString, QString>> headers, QList<QPair<QString, QString>> headers,
QHttpMultiPart *body, QHttpMultiPart *body,
std::function<void(QByteArray, QNetworkReply *)> callback); std::function<void(QByteArray, QNetworkReply *)> callback);
QString methodString(QNetworkAccessManager::Operation operation); QString methodString(QNetworkAccessManager::Operation operation);
} }
#endif // IOUTILS_HPP #endif // IOUTILS_HPP

View File

@ -4,7 +4,7 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class HistoryDialog; class HistoryDialog;
} }
class HistoryDialog : public QDialog { class HistoryDialog : public QDialog {

View File

@ -7,15 +7,15 @@
namespace requestlogging { namespace requestlogging {
struct RequestContext { struct RequestContext {
QByteArray response; QByteArray response;
QNetworkReply *reply; QNetworkReply *reply;
}; };
class LoggedRequest { class LoggedRequest {
friend QList<LoggedRequest> getRequests(); friend QList<LoggedRequest> getRequests();
public: public:
QString getUrl() { QString getUrl() {
return url; return url;
} }
@ -32,15 +32,15 @@ public:
return QFile(settings::dir().absoluteFilePath("responses/" + time)).readAll(); return QFile(settings::dir().absoluteFilePath("responses/" + time)).readAll();
} }
private: private:
QString url; QString url;
QString type; QString type;
QString time; QString time;
int responseCode; int responseCode;
}; };
QList<LoggedRequest> getRequests(); QList<LoggedRequest> getRequests();
void addEntry(RequestContext context); void addEntry(RequestContext context);
} }
#endif // REQUESTLOGGING_HPP #endif // REQUESTLOGGING_HPP

View File

@ -11,7 +11,7 @@
#include <uploaders/uploader.hpp> #include <uploaders/uploader.hpp>
namespace Ui { namespace Ui {
class MainWindow; class MainWindow;
} }
class MainWindow : public QMainWindow { class MainWindow : public QMainWindow {

View File

@ -4,7 +4,7 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class MonospaceTextDialog; class MonospaceTextDialog;
} }
class MonospaceTextDialog : public QDialog { class MonospaceTextDialog : public QDialog {

View File

@ -5,8 +5,8 @@
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
namespace notifications { namespace notifications {
void notify(QString title, QString body, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information); void notify(QString title, QString body, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information);
void notifyNolog(QString title, QString body, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information); void notifyNolog(QString title, QString body, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information);
} }
#endif // NOTIFICATIONS_HPP #endif // NOTIFICATIONS_HPP

View File

@ -4,7 +4,7 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class EncoderSettingsDialog; class EncoderSettingsDialog;
} }
class EncoderSettingsDialog : public QDialog { class EncoderSettingsDialog : public QDialog {

View File

@ -2,14 +2,14 @@
#define SCREENSHOTTER_HPP #define SCREENSHOTTER_HPP
namespace screenshotter { namespace screenshotter {
void fullscreen(); void fullscreen();
void fullscreenDelayed(); void fullscreenDelayed();
void area(); void area();
void areaDelayed(); void areaDelayed();
void activeDelayed(); void activeDelayed();
void active(); void active();
} }
#endif // SCREENSHOTTER_HPP #endif // SCREENSHOTTER_HPP

View File

@ -5,12 +5,13 @@
#include <QWidget> #include <QWidget>
namespace screenshotutil { namespace screenshotutil {
QPixmap fullscreen(bool cursor = true); QPixmap fullscreen(bool cursor = true);
QPixmap fullscreenArea(bool cursor = true, qreal x = 0, qreal y = 0, qreal w = -1, qreal h = -1); QPixmap fullscreenArea(bool cursor = true, qreal x = 0, qreal y = 0, qreal w = -1, qreal h = -1);
QPixmap window(WId wid, QScreen *w = QApplication::primaryScreen()); QPixmap window(WId wid, QScreen *w = QApplication::primaryScreen());
void toClipboard(QString value); void toClipboard(QString value);
QPoint smallestScreenCoordinate(); QPoint smallestScreenCoordinate();
QPixmap renderText(QString toRender, int padding = 5, QColor background = Qt::transparent, QColor pen = Qt::white, QFont font = QFont()); QPixmap
renderText(QString toRender, int padding = 5, QColor background = Qt::transparent, QColor pen = Qt::white, QFont font = QFont());
} }
#endif // SCREENSHOTUTIL_HPP #endif // SCREENSHOTUTIL_HPP

View File

@ -5,8 +5,8 @@
#include <QSettings> #include <QSettings>
namespace settings { namespace settings {
QSettings &settings(); QSettings &settings();
QDir dir(); QDir dir();
} }
#endif // SETTINGS_HPP #endif // SETTINGS_HPP

View File

@ -6,7 +6,7 @@
#include <uploaders/uploader.hpp> #include <uploaders/uploader.hpp>
namespace Ui { namespace Ui {
class SettingsDialog; class SettingsDialog;
} }
class SettingsDialog : public QDialog { class SettingsDialog : public QDialog {

View File

@ -4,7 +4,7 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class ImgurSettingsDialog; class ImgurSettingsDialog;
} }
class ImgurSettingsDialog : public QDialog { class ImgurSettingsDialog : public QDialog {