fixed bug #211392: Incorrect rotation angle after annotating multiple
[kphotoalbum.git] / SQLDB / DatabaseAddress.cpp
blob6d554bd4c7e59ce602e899cd0ff93e1d3706f909
1 /*
2 Copyright (C) 2006 Tuomas Suutari <thsuut@utu.fi>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program (see the file COPYING); if not, write to the
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
17 MA 02110-1301 USA.
20 #include "DatabaseAddress.h"
21 #include "Utilities/Util.h"
23 bool SQLDB::DatabaseAddress::operator==(const DatabaseAddress& other) const
25 if (isNull() || other.isNull())
26 return isNull() == other.isNull();
28 if (driverName().toLower() != other.driverName().toLower())
29 return false;
31 if (isFileBased() != other.isFileBased())
32 return false;
34 if (isFileBased())
35 return Utilities::areSameFile(databaseName(), other.databaseName());
37 if (databaseName() != other.databaseName())
38 return false;
40 if (usesLocalConnection() != other.usesLocalConnection())
41 return false;
43 if (usesLocalConnection())
44 return true;
46 return (hostName() == other.hostName() && port() == other.port());