Skip to content

Commit

Permalink
fixup:
Browse files Browse the repository at this point in the history
* more const work in class Launcher
* remove private functions without impl. from header
  • Loading branch information
ff2000 committed Oct 9, 2019
1 parent 1ef2309 commit c441103
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
15 changes: 8 additions & 7 deletions src/Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Launcher::Launcher(int argc, char * argv[]) : argc(argc), argv(argv), useGui(tru
}


int Launcher::startGUI() {
int Launcher::startGUI() const {
#ifndef NO_GUI
// Create main window
MainWindow mw;
Expand All @@ -72,22 +72,23 @@ struct CoutProgressIndicator : public ProgressIndicator {
};


std::list<LoadOptions> Launcher::getBracketedSets() {
std::list<LoadOptions> Launcher::getBracketedSets() const {
std::list<LoadOptions> result;
if (generalOptions.grouping == LoadOptions::Grouping::MANUAL) {
while(!generalOptions.fileNames.empty()) {
QStringList fileNames = generalOptions.fileNames;
while(!fileNames.empty()) {
LoadOptions opt = generalOptions;
auto oIt = opt.fileNames.begin();
auto goIt = generalOptions.fileNames.begin();
auto goIt = fileNames.begin();
std::advance(oIt, generalOptions.imagesPerBracket);
std::advance(goIt, generalOptions.imagesPerBracket);
opt.fileNames.erase(oIt, opt.fileNames.end());
generalOptions.fileNames.erase(generalOptions.fileNames.begin(), goIt);
fileNames.erase(fileNames.begin(), goIt);
result.push_back(opt);
}
} else {
std::list<std::pair<ImageIO::QDateInterval, QString>> dateNames;
for (QString & name : generalOptions.fileNames) {
for (const QString & name : generalOptions.fileNames) {
ImageIO::QDateInterval interval = ImageIO::getImageCreationInterval(name);
if (interval.start.isValid()) {
dateNames.emplace_back(interval, name);
Expand Down Expand Up @@ -121,7 +122,7 @@ std::list<LoadOptions> Launcher::getBracketedSets() {
}


int Launcher::automaticMerge() {
int Launcher::automaticMerge() const {
auto tr = [&] (const char * text) { return QCoreApplication::translate("LoadSave", text); };
std::list<LoadOptions> optionsSet;
if (generalOptions.grouping > LoadOptions::Grouping::ALL) {
Expand Down
8 changes: 3 additions & 5 deletions src/Launcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ class Launcher {
int run();

private:
bool checkGUI();
int startGUI();
int automaticMerge();
void showHelp();
std::list<LoadOptions> getBracketedSets();
int startGUI() const;
int automaticMerge() const;
std::list<LoadOptions> getBracketedSets() const;

int argc;
char ** argv;
Expand Down

0 comments on commit c441103

Please sign in to comment.