File indexing completed on 2025-03-09 04:54:37
0001 /* 0002 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "openwithurlinfo.h" 0008 0009 using namespace MessageViewer; 0010 OpenWithUrlInfo::OpenWithUrlInfo() = default; 0011 0012 OpenWithUrlInfo::~OpenWithUrlInfo() = default; 0013 0014 QDebug operator<<(QDebug d, const MessageViewer::OpenWithUrlInfo &t) 0015 { 0016 d << "command " << t.command(); 0017 d << "command line " << t.commandLine(); 0018 d << "url " << t.url(); 0019 return d; 0020 } 0021 0022 const QString &OpenWithUrlInfo::command() const 0023 { 0024 return mCommand; 0025 } 0026 0027 void OpenWithUrlInfo::setCommand(const QString &newCommand) 0028 { 0029 mCommand = newCommand; 0030 } 0031 0032 const QString &OpenWithUrlInfo::url() const 0033 { 0034 return mUrl; 0035 } 0036 0037 void OpenWithUrlInfo::setUrl(const QString &newUrl) 0038 { 0039 mUrl = newUrl; 0040 } 0041 0042 bool OpenWithUrlInfo::isValid() const 0043 { 0044 return !mUrl.isEmpty() && !mCommand.isEmpty(); 0045 } 0046 0047 const QString &OpenWithUrlInfo::commandLine() const 0048 { 0049 return mCommandLine; 0050 } 0051 0052 void OpenWithUrlInfo::setCommandLine(const QString &newCommandLine) 0053 { 0054 mCommandLine = newCommandLine; 0055 } 0056 0057 bool OpenWithUrlInfo::operator==(const OpenWithUrlInfo &other) const 0058 { 0059 return mCommandLine == other.commandLine() && mCommand == other.command() && mUrl == other.url(); 0060 } 0061 0062 #include "moc_openwithurlinfo.cpp"