Skip to content

Commit df2a147

Browse files
committed
Allways create Barcode directory.
1 parent 66a20eb commit df2a147

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

mainwidget.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ void MainWidget::checkMilestone()
226226
if(m_destinationPath.isEmpty()) {
227227

228228
if(m_drives.length() > 1 && availableDiskSpace(QString(m_drives.at(0)) + ":/") < availableDiskSpace(QString(m_drives.at(1)) + ":/")) {
229-
m_destinationPath =QString( m_drives.at(1)) + ":/" + PATH;
229+
m_destinationPath = QString( m_drives.at(1)) + ":/" + PATH;
230230
} else if(!m_drives.isEmpty()) {
231231
m_destinationPath = QString(m_drives.at(0)) + ":/" + PATH;
232232
} else {
233-
m_destinationPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
233+
m_destinationPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + PATH;
234234
}
235235

236236
QMessageBox::StandardButton button;
@@ -253,6 +253,15 @@ void MainWidget::checkMilestone()
253253
}
254254
}
255255

256+
if(m_destinationPath.endsWith("/")) {
257+
m_destinationPath.remove(m_destinationPath.length()-1,1);
258+
}
259+
260+
if(!m_destinationPath.endsWith(PATH,Qt::CaseInsensitive)) {
261+
m_destinationPath += "/";
262+
m_destinationPath += PATH;
263+
}
264+
256265
QDir dir(m_destinationPath);
257266
if(!dir.exists()) {
258267
if(!dir.mkpath(m_destinationPath)) {

0 commit comments

Comments
 (0)