Messagelib

openwithurlinfo.cpp
1/*
2 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "openwithurlinfo.h"
8
9using namespace MessageViewer;
10OpenWithUrlInfo::OpenWithUrlInfo() = default;
11
12OpenWithUrlInfo::~OpenWithUrlInfo() = default;
13
15{
16 d.space() << "command " << t.command();
17 d.space() << "command line " << t.commandLine();
18 d.space() << "url " << t.url();
19 d.space() << "isLocalOpenWith" << t.isLocalOpenWithInfo();
20 d.space() << "enabled" << t.enabled();
21 return d;
22}
23
24const QString &OpenWithUrlInfo::command() const
25{
26 return mCommand;
27}
28
29void OpenWithUrlInfo::setCommand(const QString &newCommand)
30{
31 mCommand = newCommand;
32}
33
34const QString &OpenWithUrlInfo::url() const
35{
36 return mUrl;
37}
38
39void OpenWithUrlInfo::setUrl(const QString &newUrl)
40{
41 mUrl = newUrl;
42}
43
44bool OpenWithUrlInfo::isValid() const
45{
46 return !mUrl.isEmpty() && !mCommand.isEmpty();
47}
48
49const QString &OpenWithUrlInfo::commandLine() const
50{
51 return mCommandLine;
52}
53
54void OpenWithUrlInfo::setCommandLine(const QString &newCommandLine)
55{
56 mCommandLine = newCommandLine;
57}
58
59bool OpenWithUrlInfo::operator==(const OpenWithUrlInfo &other) const
60{
61 return mCommandLine == other.commandLine() && mCommand == other.command() && mUrl == other.url() && mIsLocalOpenWithInfo == other.isLocalOpenWithInfo()
62 && mEnabled == other.enabled();
63}
64
65bool OpenWithUrlInfo::isLocalOpenWithInfo() const
66{
67 return mIsLocalOpenWithInfo;
68}
69
70void OpenWithUrlInfo::setIsLocalOpenWithInfo(bool newLocalOpenWith)
71{
72 mIsLocalOpenWithInfo = newLocalOpenWith;
73}
74
75bool OpenWithUrlInfo::enabled() const
76{
77 return mEnabled;
78}
79
80void OpenWithUrlInfo::setEnabled(bool newEnabled)
81{
82 mEnabled = newEnabled;
83}
84
85#include "moc_openwithurlinfo.cpp"
The OpenWithUrlInfo class.
QDebug operator<<(QDebug dbg, const PerceptualColor::LchaDouble &value)
QDebug & space()
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.