2023-11-01 21:11:11 +00:00
|
|
|
// This file Copyright © Mnemosyne LLC.
|
2022-02-07 16:25:02 +00:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 18:27:56 +00:00
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2010-04-27 03:10:32 +00:00
|
|
|
|
2015-06-10 21:27:11 +00:00
|
|
|
#include "AddData.h"
|
|
|
|
#include "Application.h"
|
2015-12-16 17:57:05 +00:00
|
|
|
#include "InteropObject.h"
|
2010-04-27 03:10:32 +00:00
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
InteropObject::InteropObject(QObject* parent)
|
2023-11-21 15:02:03 +00:00
|
|
|
: QObject{ parent }
|
2010-04-27 03:10:32 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-06-05 19:02:11 +00:00
|
|
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
2020-11-09 03:31:02 +00:00
|
|
|
bool InteropObject::PresentWindow() const
|
2010-04-27 03:10:32 +00:00
|
|
|
{
|
2020-11-08 19:54:40 +00:00
|
|
|
trApp->raise();
|
2017-04-19 12:04:45 +00:00
|
|
|
return true;
|
2010-04-27 03:10:32 +00:00
|
|
|
}
|
|
|
|
|
2020-06-05 19:02:11 +00:00
|
|
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
2020-11-09 03:31:02 +00:00
|
|
|
bool InteropObject::AddMetainfo(QString const& metainfo) const
|
2010-04-27 03:10:32 +00:00
|
|
|
{
|
2022-02-03 13:02:11 +00:00
|
|
|
if (auto addme = AddData(metainfo); addme.type != addme.NONE)
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2020-11-08 19:54:40 +00:00
|
|
|
trApp->addTorrent(addme);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2010-08-01 18:55:04 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
return true;
|
2010-04-27 03:10:32 +00:00
|
|
|
}
|