Skip to content

Commit 47759cd

Browse files
committed
Fix lookup of samples
The API has a new GetPath() call for finding out where all the file folders are; there was a bug where the mainwindow was not using it to get the paths. To prevent this, I've also disabled the old cached path strings in the class.
1 parent e4ae9ac commit 47759cd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/gui/qt/mainwindow.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ MainWindow::MainWindow(QApplication& app, bool i18n, QSplashScreen* splash)
229229
initDocsWindow();
230230

231231
//setup autocompletion
232-
autocomplete->loadSamples(sample_path);
232+
autocomplete->loadSamples(QString::fromStdString(m_spAPI->GetPath(SonicPiPath::SamplePath)));
233233

234234
QThreadPool::globalInstance()->setMaxThreadCount(3);
235235

@@ -456,8 +456,8 @@ void MainWindow::checkForStudioMode()
456456
std::cout << "[GUI] - Fetching Studio hashes" << std::endl;
457457
QProcess* fetchStudioHashes = new QProcess();
458458
QStringList fetch_studio_hashes_send_args;
459-
fetch_studio_hashes_send_args << fetch_url_path << "http://sonic-pi.net/static/info/studio-hashes.txt";
460-
fetchStudioHashes->start(ruby_path, fetch_studio_hashes_send_args);
459+
fetch_studio_hashes_send_args << QString::fromStdString(m_spAPI->GetPath(SonicPiPath::FetchUrlPath)) << "http://sonic-pi.net/static/info/studio-hashes.txt";
460+
fetchStudioHashes->start(QString::fromStdString(m_spAPI->GetPath(SonicPiPath::RubyPath)), fetch_studio_hashes_send_args);
461461
fetchStudioHashes->waitForFinished();
462462
QTextStream stream(fetchStudioHashes->readAllStandardOutput().trimmed());
463463
QString line = stream.readLine();

app/gui/qt/mainwindow.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,11 @@ class MainWindow : public QMainWindow
430430
std::ofstream stdlog;
431431

432432
ScintillaAPI *autocomplete;
433-
QString fetch_url_path, sample_path, log_path, sp_user_path, sp_user_tmp_path, ruby_server_path, ruby_path, server_error_log_path, server_output_log_path, gui_log_path, scsynth_log_path, init_script_path, exit_script_path, tmp_file_store, process_log_path, port_discovery_path, qt_app_theme_path, qt_browser_dark_css, qt_browser_light_css, qt_browser_hc_css;
433+
#ifdef QT_OLD_API
434+
QString fetch_url_path, sample_path, log_path, sp_user_path, sp_user_tmp_path, ruby_server_path, ruby_path, server_error_log_path, server_output_log_path, gui_log_path, scsynth_log_path, init_script_path, exit_script_path, tmp_file_store, process_log_path, port_discovery_path;
435+
#endif
436+
QString qt_browser_dark_css, qt_browser_light_css, qt_browser_hc_css, qt_app_theme_path;
437+
434438
QString defaultTextBrowserStyle;
435439

436440
QString version;

0 commit comments

Comments
 (0)