Slight code cleanup

This commit is contained in:
zvon 2020-04-16 13:23:02 +02:00
parent 8c94026156
commit 5c67310903
7 changed files with 11 additions and 11 deletions

View File

@ -38,7 +38,7 @@ public:
class Iterator { class Iterator {
public: public:
Iterator( const Directory &d_ ); explicit Iterator( const Directory &d_ );
~Iterator(); ~Iterator();
#ifdef _WIN32 #ifdef _WIN32

View File

@ -32,7 +32,7 @@ public:
private: private:
#ifdef _WIN32 #ifdef _WIN32
HINTERNET _hInternet = nullptr; HINTERNET _hInternet;
HINTERNET _hConnect = nullptr; HINTERNET _hConnect = nullptr;
std::wstring _headers = L""; std::wstring _headers = L"";
int status_code{}; int status_code{};

View File

@ -20,9 +20,9 @@ public:
~ProgressBar() = default; ~ProgressBar() = default;
#else #else
#ifndef _WIN32 #ifndef _WIN32
ProgressBar( void *pw ) : ptr( pw ){}; explicit ProgressBar( void *pw ) : ptr( pw ){};
#else #else
ProgressBar( void *hwnd ) : ptr( hwnd ){}; explicit ProgressBar( void *hwnd ) : ptr( hwnd ){};
#endif // _WIN32 #endif // _WIN32
~ProgressBar(); ~ProgressBar();
#endif // GUI #endif // GUI

View File

@ -184,7 +184,7 @@ std::vector< string > getEpisodeNames( const string &id, const string &season,
} }
std::vector< std::tuple< int, string, string, string > > std::vector< std::tuple< int, string, string, string > >
getRenamedFiles( const string &show, int season, const string id, getRenamedFiles( const string &show, int season, const string &id,
const string &language, const string &pattern, const string &language, const string &pattern,
const bool &linux, const std::map< int, string > &files, const bool &linux, const std::map< int, string > &files,
bool dvd ) { bool dvd ) {
@ -392,7 +392,7 @@ void singleSeason( const string &path, const string &show, int season,
#ifndef GUI #ifndef GUI
void multipleSeasons( const string &path, string &show, void multipleSeasons( const string &path, string &show,
const std::set< int > seasons, const string &language, const std::set< int > &seasons, const string &language,
const string &pattern, const size_t &flags ) { const string &pattern, const size_t &flags ) {
std::map< int, std::map< int, string > > season_map; std::map< int, std::map< int, string > > season_map;
iterateFS( season_map, path ); iterateFS( season_map, path );

View File

@ -41,7 +41,7 @@ void singleSeason( const string &path, const string &show, int season,
#ifdef GUI #ifdef GUI
std::vector< std::tuple< int, string, string, string > > std::vector< std::tuple< int, string, string, string > >
getRenamedFiles( const string &show, int season, const string id, getRenamedFiles( const string &show, int season, const string &id,
const string &language, const string &pattern, const string &language, const string &pattern,
const bool &linux, const std::map< int, string > &files, const bool &linux, const std::map< int, string > &files,
bool dvd = false ); bool dvd = false );
@ -55,7 +55,7 @@ std::vector< std::pair< string, string > > getLangs();
#else #else
void multipleSeasons( const string &path, string &show, void multipleSeasons( const string &path, string &show,
const std::set< int > seasons, const string &language, const std::set< int > &seasons, const string &language,
const string &pattern, const size_t &flags ); const string &pattern, const size_t &flags );
void allSeasons( const string &path, string &show, const string &language, void allSeasons( const string &path, string &show, const string &language,

View File

@ -234,7 +234,7 @@ void MainWindow::readDefaultPattern( const std::wstring &base_dir ) {
void MainWindow::process() { void MainWindow::process() {
wchar_t show[256]; wchar_t show[256];
SendMessage( show_input, WM_GETTEXT, ( WPARAM )255, ( LPARAM )show ); SendMessage( show_input, WM_GETTEXT, ( WPARAM )255, ( LPARAM )show );
if ( wcslen( show ) == 0 ) { if ( show[0] == '\0' ) {
MessageBox( window, _( SHOW_FIELD_EMPTY ), _( ERROR ), MessageBox( window, _( SHOW_FIELD_EMPTY ), _( ERROR ),
MB_OK | MB_ICONERROR ); MB_OK | MB_ICONERROR );
return; return;
@ -266,7 +266,7 @@ void MainWindow::rename() {
wchar_t path[MAX_PATH]; wchar_t path[MAX_PATH];
SendMessage( dir_input, WM_GETTEXT, ( WPARAM )MAX_PATH - 1, SendMessage( dir_input, WM_GETTEXT, ( WPARAM )MAX_PATH - 1,
( LPARAM )path ); ( LPARAM )path );
if ( wcslen( path ) == 0 ) { if ( path[0] == '\0' ) {
MessageBox( window, _( DIR_EMPTY ), _( ERROR ), MB_OK | MB_ICONERROR ); MessageBox( window, _( DIR_EMPTY ), _( ERROR ), MB_OK | MB_ICONERROR );
return; return;
} }

View File

@ -110,7 +110,7 @@ void SearchWindow::mainLoop() {
void SearchWindow::process() { void SearchWindow::process() {
wchar_t show[256]; wchar_t show[256];
SendMessage( show_input, WM_GETTEXT, ( WPARAM )255, ( LPARAM )show ); SendMessage( show_input, WM_GETTEXT, ( WPARAM )255, ( LPARAM )show );
if ( wcslen( show ) == 0 ) { if ( show[0] == '\0' ) {
MessageBox( window, _( SHOW_FIELD_EMPTY ), _( ERROR ), MessageBox( window, _( SHOW_FIELD_EMPTY ), _( ERROR ),
MB_OK | MB_ICONERROR ); MB_OK | MB_ICONERROR );
return; return;