Skip to content

Commit

Permalink
Overhaul: Formatting, warnings, and code structure cleanup
Browse files Browse the repository at this point in the history
- Lots of code formatting and applying the Haiku coding style
- Lots of compiler warnings fixed
- Checks for NULL in important places
- Switching of http -> https
- Reformat/add license headers
- Remove extra dependency file, extra generated version rdef, and Netbeans project files
- Fix README.md
- Add .editorconfig
  • Loading branch information
CodeforEvolution authored and humdinger committed Aug 20, 2020
1 parent e93748d commit 0a5af03
Show file tree
Hide file tree
Showing 48 changed files with 2,239 additions and 2,252 deletions.
5 changes: 0 additions & 5 deletions .dep.inc

This file was deleted.

12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{cpp,h}]
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/dist/*
/objects.*/
dist/*
objects*/
StreamRadio-version.rdef
23 changes: 13 additions & 10 deletions About.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*
* File: About.cpp
* Author: Kai Niessen <kai.niessen@online.de>
*
* Created on March 20, 2017, 4:11 PM
*/

#include "About.h"
#include "RadioApp.h"
#include "Utils.h"

#include <AppFileInfo.h>
#include <Application.h>
#include <Archivable.h>
Expand All @@ -35,6 +28,10 @@
#include <StringView.h>
#include <TranslationUtils.h>

#include "RadioApp.h"
#include "Utils.h"


#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "About"

Expand All @@ -52,26 +49,31 @@ About::About()
versionView->SetViewColor(238, 238, 235, 255);
versionView->SetHighColor(134, 135, 138, 255);
versionView->SetLowColor(134, 135, 138, 0);

BBitmap* banner = Utils::ResourceBitmap(RES_BANNER);
if (banner) {
if (banner != NULL) {
bounds = banner->Bounds();
ResizeTo(bounds.Width(),
bounds.Height() + versionView->PreferredSize().height);

versionView->SetFontSize(11);
versionView->SetAlignment(B_ALIGN_RIGHT);
versionView->ResizeTo(
bounds.Width(), versionView->PreferredSize().height + 2);
versionView->MoveTo(0, bounds.Height());

BView* bannerView = new BView(bounds, "bannerView",
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, B_WILL_DRAW);
AddChild(bannerView, versionView);
bannerView->SetViewBitmap(banner, B_FOLLOW_ALL_SIDES);
} else {
versionView->SetFontSize(40);
versionView->SetAlignment(B_ALIGN_CENTER);

BSize preferredSize = versionView->PreferredSize();
ResizeTo(preferredSize.width + 10, preferredSize.height);
}

CenterOnScreen();
}

Expand All @@ -97,5 +99,6 @@ About::GetAppVersion()
versionString.SetTo(versionInfo.long_info);
else
versionString = "©Fishpond 2012-2017";

return versionString;
}
27 changes: 11 additions & 16 deletions About.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,27 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _ABOUT_H
#define _ABOUT_H

/*
* File: About.h
* Author: Kai Niessen <kai.niessen@online.de>
*
* Created on March 20, 2017, 4:11 PM
*/

#ifndef ABOUT_H
#define ABOUT_H

#include <String.h>
#include <Window.h>


#define BANNER 4

class About : public BWindow
{

class About : public BWindow {
public:
About();
virtual ~About();
About();
virtual ~About();

private:
static BString GetAppVersion();
static BString GetAppVersion();
};

#endif /* ABOUT_H */

#endif // _ABOUT_H
Loading

0 comments on commit 0a5af03

Please sign in to comment.