Browse Source

Reindentation and code style update

tags/v5.0.0^2
ArsenArsen 4 years ago
parent
commit
3e6a3b0407
No known key found for this signature in database GPG Key ID: 683D2F43B0CA4BD2
  1. 3
      .clang-format
  2. 2
      src/aboutbox.hpp
  3. 2
      src/cropeditor/settings/brushpenselection.hpp
  4. 16
      src/formats.hpp
  5. 2
      src/formatter.hpp
  6. 8
      src/hotkeying.hpp
  7. 2
      src/hotkeyinputdialog.hpp
  8. 32
      src/io/ioutils.hpp
  9. 2
      src/logs/historydialog.hpp
  10. 68
      src/logs/requestlogging.hpp
  11. 2
      src/mainwindow.hpp
  12. 2
      src/monospacetextdialog.hpp
  13. 4
      src/notifications.hpp
  14. 2
      src/recording/encoders/encodersettingsdialog.hpp
  15. 12
      src/screenshotter.hpp
  16. 13
      src/screenshotutil.hpp
  17. 4
      src/settings.hpp
  18. 2
      src/settingsdialog.hpp
  19. 2
      src/uploaders/default/imgursettingsdialog.hpp

3
.clang-format

@ -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

2
src/aboutbox.hpp

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

2
src/cropeditor/settings/brushpenselection.hpp

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

16
src/formats.hpp

@ -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

2
src/formatter.hpp

@ -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

8
src/hotkeying.hpp

@ -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

2
src/hotkeyinputdialog.hpp

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

32
src/io/ioutils.hpp

@ -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

2
src/logs/historydialog.hpp

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

68
src/logs/requestlogging.hpp

@ -7,40 +7,40 @@
namespace requestlogging {
struct RequestContext {
QByteArray response;
QNetworkReply *reply;
};
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();
}
private:
QString url;
QString type;
QString time;
int responseCode;
};
QList<LoggedRequest> getRequests();
void addEntry(RequestContext context);
struct RequestContext {
QByteArray response;
QNetworkReply *reply;
};
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();
}
private:
QString url;
QString type;
QString time;
int responseCode;
};
QList<LoggedRequest> getRequests();
void addEntry(RequestContext context);
}
#endif // REQUESTLOGGING_HPP

2
src/mainwindow.hpp

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

2
src/monospacetextdialog.hpp

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

4
src/notifications.hpp

@ -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

2
src/recording/encoders/encodersettingsdialog.hpp

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

12
src/screenshotter.hpp

@ -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

13
src/screenshotutil.hpp

@ -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

4
src/settings.hpp

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

2
src/settingsdialog.hpp

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

2
src/uploaders/default/imgursettingsdialog.hpp

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

Loading…
Cancel
Save