File indexing completed on 2024-05-12 17:16:25

0001 /***************************************************************************
0002  *   Copyright (C) 2006-2009 by Rajko Albrecht                             *
0003  *   ral@alwins-world.de                                                   *
0004  *                                                                         *
0005  * This program is free software; you can redistribute it and/or           *
0006  * modify it under the terms of the GNU Lesser General Public              *
0007  * License as published by the Free Software Foundation; either            *
0008  * version 2.1 of the License, or (at your option) any later version.      *
0009  *                                                                         *
0010  * This program is distributed in the hope that it will be useful,         *
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
0013  * Lesser General Public License for more details.                         *
0014  *                                                                         *
0015  * You should have received a copy of the GNU Lesser General Public        *
0016  * License along with this program (in the file LGPL.txt); if not,         *
0017  * write to the Free Software Foundation, Inc., 51 Franklin St,            *
0018  * Fifth Floor, Boston, MA  02110-1301  USA                                *
0019  *                                                                         *
0020  * This software consists of voluntary contributions made by many          *
0021  * individuals.  For exact contribution history, see the revision          *
0022  * history and logs, available at http://kdesvn.alwins-world.de.           *
0023  ***************************************************************************/
0024 #include "version_check.h"
0025 
0026 #include <svn_version.h>
0027 #include <svn_client.h>
0028 
0029 #include <QString>
0030 
0031 namespace svn
0032 {
0033 static const svn_version_t Linkedtag = {
0034     SVN_VER_MAJOR,
0035     SVN_VER_MINOR,
0036     SVN_VER_PATCH,
0037     SVN_VER_NUMTAG
0038 };
0039 
0040 bool Version::client_version_compatible()
0041 {
0042     return svn_ver_compatible(svn_client_version(), &Linkedtag);
0043 }
0044 
0045 const QString Version::linked_version()
0046 {
0047     return QLatin1String(SVN_VERSION);
0048 }
0049 
0050 const QString Version::running_version()
0051 {
0052     static QString curr_version_string;
0053     if (curr_version_string.isEmpty()) {
0054         curr_version_string =
0055             QString(QLatin1String("%1.%2.%3.%4")).arg(svn_client_version()->major).arg(svn_client_version()->minor)
0056             .arg(svn_client_version()->patch).arg(QString::fromUtf8(svn_client_version()->tag));
0057     }
0058     return curr_version_string;
0059 }
0060 
0061 int Version::version_major()
0062 {
0063     return svn_client_version()->major;
0064 }
0065 
0066 int Version::version_minor()
0067 {
0068     return svn_client_version()->minor;
0069 }
0070 }