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
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
@ -24,7 +25,7 @@ IndentFunctionDeclarationAfterType: false
IndentWidth: 4
Language: Cpp
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
NamespaceIndentation: All
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 100

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
#include <QString>
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,12 +5,13 @@
#include <QWidget>
namespace screenshotutil {
QPixmap fullscreen(bool cursor = true);
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());
void toClipboard(QString value);
QPoint smallestScreenCoordinate();
QPixmap renderText(QString toRender, int padding = 5, QColor background = Qt::transparent, QColor pen = Qt::white, QFont font = QFont());
QPixmap fullscreen(bool cursor = true);
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());
void toClipboard(QString value);
QPoint smallestScreenCoordinate();
QPixmap
renderText(QString toRender, int padding = 5, QColor background = Qt::transparent, QColor pen = Qt::white, QFont font = QFont());
}
#endif // SCREENSHOTUTIL_HPP

View File

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

View File

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

View File

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