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 {
public:
Iterator( const Directory &d_ );
explicit Iterator( const Directory &d_ );
~Iterator();
#ifdef _WIN32

View File

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

View File

@ -20,9 +20,9 @@ public:
~ProgressBar() = default;
#else
#ifndef _WIN32
ProgressBar( void *pw ) : ptr( pw ){};
explicit ProgressBar( void *pw ) : ptr( pw ){};
#else
ProgressBar( void *hwnd ) : ptr( hwnd ){};
explicit ProgressBar( void *hwnd ) : ptr( hwnd ){};
#endif // _WIN32
~ProgressBar();
#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 > >
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 bool &linux, const std::map< int, string > &files,
bool dvd ) {
@ -392,7 +392,7 @@ void singleSeason( const string &path, const string &show, int season,
#ifndef GUI
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 ) {
std::map< int, std::map< int, string > > season_map;
iterateFS( season_map, path );

View File

@ -41,7 +41,7 @@ void singleSeason( const string &path, const string &show, int season,
#ifdef GUI
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 bool &linux, const std::map< int, string > &files,
bool dvd = false );
@ -55,7 +55,7 @@ std::vector< std::pair< string, string > > getLangs();
#else
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 );
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() {
wchar_t show[256];
SendMessage( show_input, WM_GETTEXT, ( WPARAM )255, ( LPARAM )show );
if ( wcslen( show ) == 0 ) {
if ( show[0] == '\0' ) {
MessageBox( window, _( SHOW_FIELD_EMPTY ), _( ERROR ),
MB_OK | MB_ICONERROR );
return;
@ -266,7 +266,7 @@ void MainWindow::rename() {
wchar_t path[MAX_PATH];
SendMessage( dir_input, WM_GETTEXT, ( WPARAM )MAX_PATH - 1,
( LPARAM )path );
if ( wcslen( path ) == 0 ) {
if ( path[0] == '\0' ) {
MessageBox( window, _( DIR_EMPTY ), _( ERROR ), MB_OK | MB_ICONERROR );
return;
}

View File

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