VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/manager/UICloudEntityKey.cpp@ 103977

Last change on this file since 103977 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1/* $Id: UICloudEntityKey.cpp 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UICloudEntityKey class implementation.
4 */
5
6/*
7 * Copyright (C) 2012-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28/* GUI includes: */
29#include "UICloudEntityKey.h"
30
31
32UICloudEntityKey::UICloudEntityKey(const QString &strProviderShortName /* = QString() */,
33 const QString &strProfileName /* = QString() */,
34 const QUuid &uMachineId /* = QUuid() */)
35 : m_strProviderShortName(strProviderShortName)
36 , m_strProfileName(strProfileName)
37 , m_uMachineId(uMachineId)
38{
39}
40
41UICloudEntityKey::UICloudEntityKey(const UICloudEntityKey &another)
42 : m_strProviderShortName(another.m_strProviderShortName)
43 , m_strProfileName(another.m_strProfileName)
44 , m_uMachineId(another.m_uMachineId)
45{
46}
47
48bool UICloudEntityKey::operator==(const UICloudEntityKey &another) const
49{
50 return true
51 && toString() == another.toString()
52 ;
53}
54
55bool UICloudEntityKey::operator<(const UICloudEntityKey &another) const
56{
57 return true
58 && toString() < another.toString()
59 ;
60}
61
62QString UICloudEntityKey::toString() const
63{
64 QString strResult;
65 if (m_strProviderShortName.isEmpty())
66 return strResult;
67 strResult += QString("/%1").arg(m_strProviderShortName);
68 if (m_strProfileName.isEmpty())
69 return strResult;
70 strResult += QString("/%1").arg(m_strProfileName);
71 if (m_uMachineId.isNull())
72 return strResult;
73 strResult += QString("/%1").arg(m_uMachineId.toString());
74 return strResult;
75}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette