aboutsummaryrefslogtreecommitdiff
path: root/lumina-fm
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-fm')
-rw-r--r--lumina-fm/MainUI.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp
index 298c3ee6..e2d0cbd2 100644
--- a/lumina-fm/MainUI.cpp
+++ b/lumina-fm/MainUI.cpp
@@ -857,11 +857,14 @@ void MainUI::on_tool_addNewFile_clicked(){
if(!ok || newdocument.isEmpty()){ return; }
QString full = getCurrentDir();
if(!full.endsWith("/")){ full.append("/"); }
- QDir dir(full); //open the current dir
- QFile file(dir.filePath(newdocument));
- if (!file.open(QIODevice::ReadWrite)){
- QMessageBox::warning(this, tr("Error Creating Document"), tr("The document could not be created. Please ensure that you have the proper permissions."));
+ QFile file(full+newdocument);
+ if(file.open(QIODevice::ReadWrite)){
+ //If successfully opened, it has created a blank file
+ file.close();
+ }else{
+ QMessageBox::warning(this, tr("Error Creating Document"), tr("The document could not be created. Please ensure that you have the proper permissions."));
}
+
}
void MainUI::tabChanged(int tab){
bgstack15