aboutsummaryrefslogtreecommitdiff
path: root/src/aoimage.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2020-05-22 01:18:24 +0300
committerCrystalwarrior <varsash@gmail.com>2020-05-22 01:18:24 +0300
commitc8e12558cdd3fd0769b81679ad09edf1f29b780f (patch)
tree7dae2225e574c3ee55d6b82a1d2f399db4ace5c0 /src/aoimage.cpp
parentdfac0652c8eb9bd48ceea7ae755e9c2f7e5cb1a2 (diff)
Clang-ify the code with this styling using Visual Studio Code:
{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Stroustrup, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All } (this is the Visual Studio preset with only "BreakBeforeBraces" changed from Allman to Stroustrup)
Diffstat (limited to 'src/aoimage.cpp')
-rw-r--r--src/aoimage.cpp51
1 files changed, 24 insertions, 27 deletions
diff --git a/src/aoimage.cpp b/src/aoimage.cpp
index 17c2ea61..e1c01e55 100644
--- a/src/aoimage.cpp
+++ b/src/aoimage.cpp
@@ -4,49 +4,46 @@
AOImage::AOImage(QWidget *parent, AOApplication *p_ao_app) : QLabel(parent)
{
- m_parent = parent;
- ao_app = p_ao_app;
+ m_parent = parent;
+ ao_app = p_ao_app;
}
AOImage::~AOImage()
{
-
}
bool AOImage::set_image(QString p_image)
{
- QString theme_image_path = ao_app->get_static_image_suffix(ao_app->get_theme_path(p_image));
- QString default_image_path = ao_app->get_static_image_suffix(ao_app->get_default_theme_path(p_image));
+ QString theme_image_path = ao_app->get_static_image_suffix(ao_app->get_theme_path(p_image));
+ QString default_image_path = ao_app->get_static_image_suffix(ao_app->get_default_theme_path(p_image));
- QString final_image_path;
+ QString final_image_path;
- if (file_exists(theme_image_path))
- final_image_path = theme_image_path;
- else if (file_exists(default_image_path))
- final_image_path = default_image_path;
- else
- {
- qDebug() << "Warning: Image" << p_image << "not found! Can't set!";
- return false;
- }
+ if (file_exists(theme_image_path))
+ final_image_path = theme_image_path;
+ else if (file_exists(default_image_path))
+ final_image_path = default_image_path;
+ else {
+ qDebug() << "Warning: Image" << p_image << "not found! Can't set!";
+ return false;
+ }
- QPixmap f_pixmap(final_image_path);
+ QPixmap f_pixmap(final_image_path);
- this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio));
- return true;
+ this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio));
+ return true;
}
bool AOImage::set_chatbox(QString p_path)
{
- p_path = ao_app->get_static_image_suffix(p_path);
- if (!file_exists(p_path))
- {
- qDebug() << "Warning: Chatbox" << p_path << "not found! Can't set!";
- return false;
- }
+ p_path = ao_app->get_static_image_suffix(p_path);
+ if (!file_exists(p_path)) {
+ qDebug() << "Warning: Chatbox" << p_path << "not found! Can't set!";
+ return false;
+ }
- QPixmap f_pixmap(p_path);
+ QPixmap f_pixmap(p_path);
- this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio));
- return true;
+ this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio));
+ return true;
}