Extract library paths methods to it's own struct in yacreader_global.h and use it everywhere

This commit is contained in:
Luis Ángel San Martín
2025-03-29 11:31:53 +01:00
parent 5aa637fdbe
commit d4b7c6dd8a
15 changed files with 133 additions and 90 deletions

View File

@ -1,4 +1,5 @@
#include "create_library_dialog.h"
#include "yacreader_global.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
@ -6,6 +7,8 @@
#include <QSizePolicy>
#include <QMessageBox>
using namespace YACReader;
CreateLibraryDialog::CreateLibraryDialog(QWidget *parent)
: QDialog(parent)
{
@ -87,7 +90,7 @@ void CreateLibraryDialog::create()
QFileInfo f(path->text());
if (f.exists() && f.isDir() && f.isWritable()) {
if (!libraries.contains(nameEdit->text())) {
emit createLibrary(QDir::cleanPath(path->text()), QDir::cleanPath(path->text()) + "/.yacreaderlibrary", nameEdit->text());
emit createLibrary(QDir::cleanPath(path->text()), LibraryPaths::libraryDataPath(QDir::cleanPath(path->text())), nameEdit->text());
close();
} else
emit libraryExists(nameEdit->text());