mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Improve .torrent associate handling
* Use correct pointer type in NSIS scripts * Only remove qbt specific registry keys when uninstalling or disassociating * Set .torrent Content Type when associating .torrent format * Move ".torrent association" functions to Utils::OS class PR #19709.
This commit is contained in:
parent
90e023f138
commit
cba433823f
10 changed files with 276 additions and 185 deletions
|
@ -99,6 +99,10 @@
|
|||
#include "gui/uithememanager.h"
|
||||
#include "gui/utils.h"
|
||||
#include "gui/windowstate.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "base/utils/os.h"
|
||||
#endif // Q_OS_WIN
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
|
@ -883,14 +887,14 @@ int Application::exec()
|
|||
delete m_startupProgressDialog;
|
||||
#ifdef Q_OS_WIN
|
||||
auto *pref = Preferences::instance();
|
||||
if (!pref->neverCheckFileAssoc() && (!Preferences::isTorrentFileAssocSet() || !Preferences::isMagnetLinkAssocSet()))
|
||||
if (!pref->neverCheckFileAssoc() && (!Utils::OS::isTorrentFileAssocSet() || !Utils::OS::isMagnetLinkAssocSet()))
|
||||
{
|
||||
if (QMessageBox::question(m_window, tr("Torrent file association")
|
||||
, tr("qBittorrent is not the default application for opening torrent files or Magnet links.\nDo you want to make qBittorrent the default application for these?")
|
||||
, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
|
||||
{
|
||||
pref->setTorrentFileAssoc(true);
|
||||
pref->setMagnetLinkAssoc(true);
|
||||
Utils::OS::setTorrentFileAssoc(true);
|
||||
Utils::OS::setMagnetLinkAssoc(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue