mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
Unify singleton pattern in Profile class
1. Use unified function names `initInstance()` and `freeInstance()` and make them public. 2. Add `freeInstance()` to avoid noise from memory leak detectors. 3. Let `instance()`return a pointer directly to avoid unnecessary indirections when invoking functions.
This commit is contained in:
committed by
sledgehammer999
parent
5e73afa04e
commit
534549142e
@@ -1763,9 +1763,9 @@ void TorrentHandle::handleSaveResumeDataAlert(const lt::save_resume_data_alert *
|
||||
}
|
||||
else {
|
||||
const auto savePath = resumeData.find_key("save_path")->string();
|
||||
resumeData["save_path"] = Profile::instance().toPortablePath(QString::fromStdString(savePath)).toStdString();
|
||||
resumeData["save_path"] = Profile::instance()->toPortablePath(QString::fromStdString(savePath)).toStdString();
|
||||
}
|
||||
resumeData["qBt-savePath"] = m_useAutoTMM ? "" : Profile::instance().toPortablePath(m_savePath).toStdString();
|
||||
resumeData["qBt-savePath"] = m_useAutoTMM ? "" : Profile::instance()->toPortablePath(m_savePath).toStdString();
|
||||
resumeData["qBt-ratioLimit"] = static_cast<int>(m_ratioLimit * 1000);
|
||||
resumeData["qBt-seedingTimeLimit"] = m_seedingTimeLimit;
|
||||
resumeData["qBt-category"] = m_category.toStdString();
|
||||
|
||||
Reference in New Issue
Block a user