diff options
author | Chris Xiong <chirs241097@gmail.com> | 2020-05-12 00:58:40 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2020-05-12 00:58:40 +0800 |
commit | a7407edaf81c685d4a389785a405a53a5de4b148 (patch) | |
tree | e6e4f2d85f2172c94ac83a6e8f01e1e90a78ede9 /qmidiplayer-desktop/qmphelpwindow.cpp | |
parent | 437b7b16c322a8e53ac55a5f831098494d9a7073 (diff) | |
download | QMidiPlayer-a7407edaf81c685d4a389785a405a53a5de4b148.tar.xz |
Format EVERYTHING.
Hopefully this will make the source code less horrendous and actually
readable.
The command used was:
```
astyle --suffix=none --style=allman --attach-extern-c --attach-closing-while --indent-switches --indent-after-parens --pad-oper --pad-header --unpad-paren --align-pointer=name --recursive './*.cpp,*.hpp'
```
Diffstat (limited to 'qmidiplayer-desktop/qmphelpwindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmphelpwindow.cpp | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/qmidiplayer-desktop/qmphelpwindow.cpp b/qmidiplayer-desktop/qmphelpwindow.cpp index 4579e2c..082c2f6 100644 --- a/qmidiplayer-desktop/qmphelpwindow.cpp +++ b/qmidiplayer-desktop/qmphelpwindow.cpp @@ -2,43 +2,44 @@ #include "qmphelpwindow.hpp" #include "ui_qmphelpwindow.h" -static const char *months="JanFebMarAprMayJunJulAugSepOctNovDec"; +static const char *months = "JanFebMarAprMayJunJulAugSepOctNovDec"; std::string parseDate(const char *date) { - char ms[8]; - int y,d,m;sscanf(date,"%s %d %d",ms,&d,&y); - m=(strstr(months,ms)-months)/3+1; - char r[16]; - sprintf(r,"%04d-%02d-%02d",y,m,d); - return std::string(r); + char ms[8]; + int y, d, m; + sscanf(date, "%s %d %d", ms, &d, &y); + m = (strstr(months, ms) - months) / 3 + 1; + char r[16]; + sprintf(r, "%04d-%02d-%02d", y, m, d); + return std::string(r); } qmpHelpWindow::qmpHelpWindow(QWidget *parent) : - QDialog(parent), - ui(new Ui::qmpHelpWindow) + QDialog(parent), + ui(new Ui::qmpHelpWindow) { - ui->setupUi(this); - ui->textBrowser->setSearchPaths(QStringList(QString(":/doc"))+QStringList(QString(":/img"))); - ui->textBrowser->setSource(QUrl("qrc:///doc/index_internal.html")); + ui->setupUi(this); + ui->textBrowser->setSearchPaths(QStringList(QString(":/doc")) + QStringList(QString(":/img"))); + ui->textBrowser->setSource(QUrl("qrc:///doc/index_internal.html")); } qmpHelpWindow::~qmpHelpWindow() { - delete ui; + delete ui; } void qmpHelpWindow::on_textBrowser_sourceChanged(const QUrl &src) { - if(src.fileName()==QString("version_internal.html")) - { - QString s=ui->textBrowser->toHtml(); - s.replace("CT_QT_VERSION_STR",QT_VERSION_STR); - s.replace("RT_QT_VERSION_STR",qVersion()); - s.replace("CT_FLUIDSYNTH_VERSION",FLUIDSYNTH_VERSION); - s.replace("RT_FLUIDSYNTH_VERSION",fluid_version_str()); - s.replace("APP_VERSION",APP_VERSION); - s.replace("BUILD_DATE",parseDate(__DATE__).c_str()); - s.replace("BUILD_MACHINE",QT_STRINGIFY(BUILD_MACHINE)); - ui->textBrowser->setHtml(s); - } + if (src.fileName() == QString("version_internal.html")) + { + QString s = ui->textBrowser->toHtml(); + s.replace("CT_QT_VERSION_STR", QT_VERSION_STR); + s.replace("RT_QT_VERSION_STR", qVersion()); + s.replace("CT_FLUIDSYNTH_VERSION", FLUIDSYNTH_VERSION); + s.replace("RT_FLUIDSYNTH_VERSION", fluid_version_str()); + s.replace("APP_VERSION", APP_VERSION); + s.replace("BUILD_DATE", parseDate(__DATE__).c_str()); + s.replace("BUILD_MACHINE", QT_STRINGIFY(BUILD_MACHINE)); + ui->textBrowser->setHtml(s); + } } |