Skip to content

Commit

Permalink
Allways create Barcode directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeBergmann committed Apr 13, 2015
1 parent 66a20eb commit df2a147
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mainwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ void MainWidget::checkMilestone()
if(m_destinationPath.isEmpty()) {

if(m_drives.length() > 1 && availableDiskSpace(QString(m_drives.at(0)) + ":/") < availableDiskSpace(QString(m_drives.at(1)) + ":/")) {
m_destinationPath =QString( m_drives.at(1)) + ":/" + PATH;
m_destinationPath = QString( m_drives.at(1)) + ":/" + PATH;
} else if(!m_drives.isEmpty()) {
m_destinationPath = QString(m_drives.at(0)) + ":/" + PATH;
} else {
m_destinationPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
m_destinationPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + PATH;
}

QMessageBox::StandardButton button;
Expand All @@ -253,6 +253,15 @@ void MainWidget::checkMilestone()
}
}

if(m_destinationPath.endsWith("/")) {
m_destinationPath.remove(m_destinationPath.length()-1,1);
}

if(!m_destinationPath.endsWith(PATH,Qt::CaseInsensitive)) {
m_destinationPath += "/";
m_destinationPath += PATH;
}

QDir dir(m_destinationPath);
if(!dir.exists()) {
if(!dir.mkpath(m_destinationPath)) {
Expand Down

0 comments on commit df2a147

Please sign in to comment.