Skip to content

Commit ac1d9e5

Browse files
Re-format project
1 parent 607ab85 commit ac1d9e5

15 files changed

Lines changed: 214 additions & 214 deletions

src/ffi/namespace/include/utils.hxx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
#include "../../raw/utils.hxx"
44

55
namespace Lazyboard::ffi {
6-
inline OpenBrowserStatus open_browser(const char* url) {
7-
auto result = raw_open_browser(url);
6+
inline OpenBrowserStatus open_browser(const char *url) {
7+
auto result = raw_open_browser(url);
88

9-
return result;
9+
return result;
1010
}
1111

12-
inline CreateFileSystemStatus new_folder(const char* path) {
13-
auto result = raw_new_folder(path);
12+
inline CreateFileSystemStatus new_folder(const char *path) {
13+
auto result = raw_new_folder(path);
1414

15-
return result;
15+
return result;
1616
}
1717

18-
inline bool is_exists_path(char* path) {
19-
auto result = raw_is_path_exists(path);
18+
inline bool is_exists_path(char *path) {
19+
auto result = raw_is_path_exists(path);
2020

21-
return result;
21+
return result;
2222
}
2323

24-
inline void free_c_str(char* c_str) { raw_free_c_str(c_str); }
24+
inline void free_c_str(char *c_str) { raw_free_c_str(c_str); }
2525
} // namespace Lazyboard::ffi
2626

27-
#endif // UTILS_HXX
27+
#endif // UTILS_HXX

src/ffi/raw/utils.hxx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ extern "C" {
99
using std::uint8_t;
1010

1111
enum class OpenBrowserStatus : uint8_t {
12-
OK,
13-
WRAP_RAW_C_FAILED,
14-
URL_IS_EMPTY,
15-
OPEN_BROWSER_FAILED,
12+
OK,
13+
WRAP_RAW_C_FAILED,
14+
URL_IS_EMPTY,
15+
OPEN_BROWSER_FAILED,
1616
};
1717

1818
enum class CreateFileSystemStatus : uint8_t {
19-
OK,
20-
WRAP_RAW_C_FAILED,
21-
FAILED,
19+
OK,
20+
WRAP_RAW_C_FAILED,
21+
FAILED,
2222
};
2323

24-
OpenBrowserStatus raw_open_browser(const char* url);
25-
CreateFileSystemStatus raw_new_folder(const char* path);
26-
bool raw_is_path_exists(const char* path);
27-
void raw_free_c_str(char* c_str);
24+
OpenBrowserStatus raw_open_browser(const char *url);
25+
CreateFileSystemStatus raw_new_folder(const char *path);
26+
bool raw_is_path_exists(const char *path);
27+
void raw_free_c_str(char *c_str);
2828

2929
#ifdef __cplusplus
3030
}
3131
#endif
32-
#endif // UTILS_RAW_HXX
32+
#endif // UTILS_RAW_HXX

src/front_end/about_widget.cxx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ using Self = AboutWidget;
1717
AboutWidget::AboutWidget() { show_about = make_unique<QPushButton>(); }
1818

1919
void Self::setup_event() {
20-
const auto function = [this]() {
21-
if (!about_window) {
22-
about_window = make_unique<AboutWindow>();
23-
}
20+
const auto function = [this]() {
21+
if (!about_window) {
22+
about_window = make_unique<AboutWindow>();
23+
}
2424

25-
about_window->show_window();
26-
};
25+
about_window->show_window();
26+
};
2727

28-
QObject::connect(show_about.get(), &QPushButton::clicked, function);
28+
QObject::connect(show_about.get(), &QPushButton::clicked, function);
2929
}
3030

31-
void Self::setup_widget(QGridLayout* grid_layout) {
32-
show_about->setText("About");
33-
this->setup_event();
34-
grid_layout->addWidget(show_about.get(), 1, 1);
31+
void Self::setup_widget(QGridLayout *grid_layout) {
32+
show_about->setText("About");
33+
this->setup_event();
34+
grid_layout->addWidget(show_about.get(), 1, 1);
3535
}

src/front_end/about_window.cxx

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -16,72 +16,72 @@ using std::make_unique;
1616
using Self = AboutWindow;
1717

1818
AboutWindow::AboutWindow() {
19-
about_window = make_unique<QDialog>();
20-
grid_layout = make_unique<QGridLayout>();
21-
github_button = make_unique<QPushButton>();
22-
github_issue_button = make_unique<QPushButton>();
23-
github_pull_button = make_unique<QPushButton>();
19+
about_window = make_unique<QDialog>();
20+
grid_layout = make_unique<QGridLayout>();
21+
github_button = make_unique<QPushButton>();
22+
github_issue_button = make_unique<QPushButton>();
23+
github_pull_button = make_unique<QPushButton>();
2424
}
2525

2626
void Self::is_open_browser_ok(OpenBrowserStatus status) {
27-
switch (status) {
28-
case OpenBrowserStatus::OK:
29-
break;
30-
31-
case OpenBrowserStatus::OPEN_BROWSER_FAILED:
32-
QMessageBox::critical(about_window.get(), "Error",
33-
"Could not open your browser");
34-
break;
35-
36-
case OpenBrowserStatus::WRAP_RAW_C_FAILED:
37-
QMessageBox::critical(about_window.get(), "Error",
38-
"Could not wrap C raw to safety string");
39-
40-
break;
41-
case OpenBrowserStatus::URL_IS_EMPTY:
42-
QMessageBox::critical(about_window.get(), "Error", "Url is empty");
43-
break;
44-
}
27+
switch (status) {
28+
case OpenBrowserStatus::OK:
29+
break;
30+
31+
case OpenBrowserStatus::OPEN_BROWSER_FAILED:
32+
QMessageBox::critical(about_window.get(), "Error",
33+
"Could not open your browser");
34+
break;
35+
36+
case OpenBrowserStatus::WRAP_RAW_C_FAILED:
37+
QMessageBox::critical(about_window.get(), "Error",
38+
"Could not wrap C raw to safety string");
39+
40+
break;
41+
case OpenBrowserStatus::URL_IS_EMPTY:
42+
QMessageBox::critical(about_window.get(), "Error", "Url is empty");
43+
break;
44+
}
4545
}
4646

47-
void Self::open_browser_when_clicked(QPushButton* button, const char* url) {
48-
const auto open_browser = [this, url] {
49-
auto status = Lazyboard::ffi::open_browser(url);
50-
is_open_browser_ok(status);
51-
};
47+
void Self::open_browser_when_clicked(QPushButton *button, const char *url) {
48+
const auto open_browser = [this, url] {
49+
auto status = Lazyboard::ffi::open_browser(url);
50+
is_open_browser_ok(status);
51+
};
5252

53-
QObject::connect(button, &QPushButton::clicked, open_browser);
53+
QObject::connect(button, &QPushButton::clicked, open_browser);
5454
}
5555

5656
void Self::setup_buttons() {
57-
github_button->setText("GitHub | Source Code");
58-
github_button->setToolTip("Get Lazyboard source code");
57+
github_button->setText("GitHub | Source Code");
58+
github_button->setToolTip("Get Lazyboard source code");
5959

60-
github_issue_button->setText("Issue | Bug Report");
61-
github_issue_button->setToolTip("Report issue/bug");
60+
github_issue_button->setText("Issue | Bug Report");
61+
github_issue_button->setToolTip("Report issue/bug");
6262

63-
github_pull_button->setText("Pull Request | Contribute");
64-
github_pull_button->setToolTip("Contribute");
63+
github_pull_button->setText("Pull Request | Contribute");
64+
github_pull_button->setToolTip("Contribute");
6565

66-
this->open_browser_when_clicked(github_button.get(), GITHUB_URL);
67-
this->open_browser_when_clicked(github_issue_button.get(),
68-
GITHUB_ISSUE_URL);
69-
this->open_browser_when_clicked(github_pull_button.get(), GITHUB_PULL_URL);
66+
this->open_browser_when_clicked(github_button.get(), GITHUB_URL);
67+
this->open_browser_when_clicked(github_issue_button.get(),
68+
GITHUB_ISSUE_URL);
69+
this->open_browser_when_clicked(github_pull_button.get(), GITHUB_PULL_URL);
7070

71-
grid_layout->addWidget(github_button.get(), 0, 0);
72-
grid_layout->addWidget(github_issue_button.get(), 0, 1);
73-
grid_layout->addWidget(github_pull_button.get(), 1, 0);
71+
grid_layout->addWidget(github_button.get(), 0, 0);
72+
grid_layout->addWidget(github_issue_button.get(), 0, 1);
73+
grid_layout->addWidget(github_pull_button.get(), 1, 0);
7474
}
7575

7676
void Self::setup_front_end() {
77-
about_window->setLayout(this->grid_layout.get());
78-
this->setup_buttons();
77+
about_window->setLayout(this->grid_layout.get());
78+
this->setup_buttons();
7979
}
8080

8181
void Self::show_window() {
82-
about_window->setMinimumSize(MIN_WIDTH, MIN_HEIGHT);
83-
about_window->setWindowTitle("Lazyboard About");
82+
about_window->setMinimumSize(MIN_WIDTH, MIN_HEIGHT);
83+
about_window->setWindowTitle("Lazyboard About");
8484

85-
this->setup_front_end();
86-
about_window->exec();
85+
this->setup_front_end();
86+
about_window->exec();
8787
}

src/front_end/include/about_widget.hxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ using std::unique_ptr;
1313
namespace Lazyboard::front_end {
1414
class AboutWidget {
1515
public:
16-
AboutWidget();
16+
AboutWidget();
1717

1818
private:
19-
unique_ptr<QPushButton> show_about;
20-
unique_ptr<AboutWindow> about_window;
19+
unique_ptr<QPushButton> show_about;
20+
unique_ptr<AboutWindow> about_window;
2121

2222
private:
23-
void setup_event();
23+
void setup_event();
2424

2525
public:
26-
void setup_widget(QGridLayout* layout);
26+
void setup_widget(QGridLayout *layout);
2727
};
2828

2929
} // namespace Lazyboard::front_end
3030

31-
#endif // ABOUT_WIDGET_HXX
31+
#endif // ABOUT_WIDGET_HXX

src/front_end/include/about_window.hxx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@ using std::unique_ptr;
1313
namespace Lazyboard::front_end {
1414
class AboutWindow {
1515
private:
16-
unique_ptr<QDialog> about_window;
17-
unique_ptr<QGridLayout> grid_layout;
18-
unique_ptr<QPushButton> github_button;
19-
unique_ptr<QPushButton> github_issue_button;
20-
unique_ptr<QPushButton> github_pull_button;
16+
unique_ptr<QDialog> about_window;
17+
unique_ptr<QGridLayout> grid_layout;
18+
unique_ptr<QPushButton> github_button;
19+
unique_ptr<QPushButton> github_issue_button;
20+
unique_ptr<QPushButton> github_pull_button;
2121

2222
private:
23-
static constexpr int MIN_WIDTH = 600;
24-
static constexpr int MIN_HEIGHT = 600;
25-
const char* GITHUB_URL = "https://github.com/reim-developer/zClipboard";
26-
const char* GITHUB_ISSUE_URL =
27-
"https://github.com/reim-developer/zClipboard/issues";
28-
const char* GITHUB_PULL_URL =
29-
"https://github.com/reim-developer/zClipboard/pulls";
23+
static constexpr int MIN_WIDTH = 600;
24+
static constexpr int MIN_HEIGHT = 600;
25+
const char *GITHUB_URL = "https://github.com/reim-developer/zClipboard";
26+
const char *GITHUB_ISSUE_URL =
27+
"https://github.com/reim-developer/zClipboard/issues";
28+
const char *GITHUB_PULL_URL =
29+
"https://github.com/reim-developer/zClipboard/pulls";
3030

3131
private:
32-
void is_open_browser_ok(OpenBrowserStatus status);
33-
void open_browser_when_clicked(QPushButton* button, const char* url);
32+
void is_open_browser_ok(OpenBrowserStatus status);
33+
void open_browser_when_clicked(QPushButton *button, const char *url);
3434

3535
private:
36-
void setup_front_end();
37-
void setup_buttons();
36+
void setup_front_end();
37+
void setup_buttons();
3838

3939
public:
40-
AboutWindow();
41-
void show_window();
40+
AboutWindow();
41+
void show_window();
4242
};
4343
} // namespace Lazyboard::front_end
4444

src/front_end/include/main_window.hxx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@ using std::unique_ptr;
1919
namespace Lazyboard::front_end {
2020
class MainWindow {
2121
private:
22-
using Self = MainWindow;
23-
using Window = QMainWindow;
24-
using Layout = QGridLayout;
22+
using Self = MainWindow;
23+
using Window = QMainWindow;
24+
using Layout = QGridLayout;
2525

2626
private:
27-
static constexpr int MIN_WIDTH = 600;
28-
static constexpr int MIN_HEIGHT = 400;
27+
static constexpr int MIN_WIDTH = 600;
28+
static constexpr int MIN_HEIGHT = 400;
2929

3030
public:
31-
MainWindow();
31+
MainWindow();
3232

3333
private:
34-
Layout* grid_layout;
35-
QWidget* central_widget;
34+
Layout *grid_layout;
35+
QWidget *central_widget;
3636

3737
private:
38-
unique_ptr<Window> main_window;
39-
unique_ptr<TableWidget> table_widget;
40-
unique_ptr<SettingWidget> setting_widget;
41-
unique_ptr<AboutWidget> about_widget;
42-
unique_ptr<MainWindowPreload> main_window_preload;
38+
unique_ptr<Window> main_window;
39+
unique_ptr<TableWidget> table_widget;
40+
unique_ptr<SettingWidget> setting_widget;
41+
unique_ptr<AboutWidget> about_widget;
42+
unique_ptr<MainWindowPreload> main_window_preload;
4343

4444
public:
45-
Self* init_main_window();
46-
void front_end_show();
45+
Self *init_main_window();
46+
void front_end_show();
4747
};
4848
} // namespace Lazyboard::front_end
4949

50-
#endif // MAIN_WINDOWS_HXX
50+
#endif // MAIN_WINDOWS_HXX

src/front_end/include/setting_widget.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ using std::unique_ptr;
1111
namespace Lazyboard::front_end {
1212
class SettingWidget {
1313
private:
14-
unique_ptr<QPushButton> open_setting;
14+
unique_ptr<QPushButton> open_setting;
1515

1616
public:
17-
SettingWidget();
18-
void setup_widget(QGridLayout* grid_layout);
17+
SettingWidget();
18+
void setup_widget(QGridLayout *grid_layout);
1919
};
2020

2121
} // namespace Lazyboard::front_end

0 commit comments

Comments
 (0)