@@ -47,17 +47,12 @@ MainWindow::MainWindow(SqPackResource *data)
4747 dummyWidget->addWidget (m_exdPart);
4848
4949 connect (listWidget, &SheetListWidget::sheetSelected, this , [this , data](const QString &name) {
50- QString definitionPath;
51-
52- const QDir dataDir = QStandardPaths::writableLocation (QStandardPaths::AppDataLocation);
53- const QDir definitionsDir = dataDir.absoluteFilePath (QStringLiteral (" definitions" ));
54-
5550 auto path = QStringLiteral (" exd/%1.exh" ).arg (name.toLower ());
5651 auto pathStd = path.toStdString ();
5752
5853 auto file = physis_gamedata_extract_file (data, pathStd.c_str ());
5954
60- m_exdPart->loadSheet (name, file, definitionsDir. absoluteFilePath ( QStringLiteral ( " %1.json " ). arg (name)) );
55+ m_exdPart->loadSheet (name, file);
6156
6257 setWindowTitle (name);
6358 });
@@ -95,13 +90,13 @@ static bool copyDirectory(const QString &srcFilePath, const QString &tgtFilePath
9590
9691void MainWindow::setupActions ()
9792{
98- auto openList = new QAction (i18nc (" @action:inmenu" , " Import Definitions …" ));
93+ auto openList = new QAction (i18nc (" @action:inmenu" , " Import Schema …" ));
9994 openList->setIcon (QIcon::fromTheme (QStringLiteral (" document-open" )));
10095 connect (openList, &QAction::triggered, [this ] {
101- auto fileName = QFileDialog::getExistingDirectory (nullptr , i18nc (" @title:window" , " Open Defintions Directory" ), QStringLiteral (" ~" ));
96+ auto fileName = QFileDialog::getExistingDirectory (nullptr , i18nc (" @title:window" , " Open Schema Directory" ), QStringLiteral (" ~" ));
10297
10398 const QDir dataDir = QStandardPaths::writableLocation (QStandardPaths::AppDataLocation);
104- const QDir definitionsDir = dataDir.absoluteFilePath (QStringLiteral (" definitions " ));
99+ const QDir definitionsDir = dataDir.absoluteFilePath (QStringLiteral (" schema " ));
105100
106101 // delete old directory
107102 if (definitionsDir.exists ()) {
@@ -112,18 +107,18 @@ void MainWindow::setupActions()
112107
113108 copyDirectory (fileName, definitionsDir.absolutePath ());
114109
115- QMessageBox::information (this , i18nc (" @title:window" , " Definitions " ), i18n (" Successfully imported definitions !" ));
110+ QMessageBox::information (this , i18nc (" @title:window" , " Schema " ), i18n (" Successfully imported schema !" ));
116111 });
117112 actionCollection ()->addAction (QStringLiteral (" import_list" ), openList);
118113
119- auto downloadList = new QAction (i18nc (" @action:inmenu" , " Download Definitions …" ));
114+ auto downloadList = new QAction (i18nc (" @action:inmenu" , " Download Schema …" ));
120115 downloadList->setIcon (QIcon::fromTheme (QStringLiteral (" download-symbolic" )));
121116 connect (downloadList, &QAction::triggered, [this ] {
122117 const int ret = QMessageBox::information (
123118 this ,
124119 i18nc (" @title:window" , " Download Confirmation" ),
125- i18n (" Novus will download the definitions from the <a "
126- " href=\" https://github.com/xivapi/SaintCoinach \" >SaintCoinach repository on GitHub</a>.<br><br>Would you still like to continue?" ),
120+ i18n (" Novus will download the schema from the <a "
121+ " href=\" https://github.com/xivdev/EXDSchema \" >EXDSchema repository on GitHub</a>.<br><br>Would you still like to continue?" ),
127122 QMessageBox::Ok | QMessageBox::Cancel,
128123 QMessageBox::Ok);
129124
@@ -134,7 +129,7 @@ void MainWindow::setupActions()
134129 QUrl url;
135130 url.setScheme (QStringLiteral (" https" ));
136131 url.setHost (QStringLiteral (" github.com" ));
137- url.setPath (QStringLiteral (" /xivapi/SaintCoinach /releases/latest/download/Godbert .zip" ));
132+ url.setPath (QStringLiteral (" /xivdev/EXDSchema /releases/latest/download/latest .zip" ));
138133
139134 // TODO: Use Qcoro?
140135 auto reply = mgr->get (QNetworkRequest (url));
@@ -143,22 +138,22 @@ void MainWindow::setupActions()
143138
144139 QTemporaryDir tempDir;
145140
146- QFile file (tempDir.filePath (QStringLiteral (" Godbert .zip" )));
141+ QFile file (tempDir.filePath (QStringLiteral (" latest .zip" )));
147142 file.open (QIODevice::WriteOnly);
148143 file.write (reply->readAll ());
149144 file.close ();
150145
151- KZip archive (tempDir.filePath (QStringLiteral (" Godbert .zip" )));
146+ KZip archive (tempDir.filePath (QStringLiteral (" latest .zip" )));
152147 if (!archive.open (QIODevice::ReadOnly)) {
153148 // TODO: these should show as message boxes
154149 qFatal () << " Failed to open Godbert zip!" ;
155150 return ;
156151 }
157152
158- const KArchiveDirectory *root = dynamic_cast <const KArchiveDirectory *>(archive.directory ()-> entry ( QStringLiteral ( " Definitions " )) );
153+ const KArchiveDirectory *root = dynamic_cast <const KArchiveDirectory *>(archive.directory ());
159154
160155 const QDir dataDir = QStandardPaths::writableLocation (QStandardPaths::AppDataLocation);
161- const QDir definitionsDir = dataDir.absoluteFilePath (QStringLiteral (" definitions " ));
156+ const QDir definitionsDir = dataDir.absoluteFilePath (QStringLiteral (" schema " ));
162157
163158 // delete old directory
164159 if (definitionsDir.exists ()) {
@@ -171,7 +166,7 @@ void MainWindow::setupActions()
171166
172167 archive.close ();
173168
174- QMessageBox::information (this , i18nc (" @title:window" , " Definitions " ), i18n (" Successfully downloaded and imported definitions !" ));
169+ QMessageBox::information (this , i18nc (" @title:window" , " Schema " ), i18n (" Successfully downloaded and imported schema !" ));
175170 });
176171 });
177172 actionCollection ()->addAction (QStringLiteral (" download_list" ), downloadList);
0 commit comments