File indexing completed on 2024-05-12 05:44:23

0001 /***************************************************************************
0002  *   Copyright (C) 2009 by Rajko Albrecht  ral@alwins-world.de             *
0003  *   https://kde.org/applications/development/org.kde.kdesvn               *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (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         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; if not, write to the                         *
0017  *   Free Software Foundation, Inc.,                                       *
0018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
0019  ***************************************************************************/
0020 
0021 #ifndef SVNTHREAD_H
0022 #define SVNTHREAD_H
0023 
0024 #include "svnfrontend/frontendtypes.h"
0025 #include "tcontextlistener.h"
0026 
0027 #include <QThread>
0028 
0029 //! Base class for creating threads holding an subversion connection
0030 class SvnThread : public QThread
0031 {
0032     Q_OBJECT
0033 public:
0034     //! Creator
0035     /*!
0036      * \param parent A qobject derived class which should have a qt-slot slotNotifyMessage(const QString&)
0037      */
0038     explicit SvnThread(QObject *parent);
0039     ~SvnThread() override;
0040     void run() override = 0;
0041     virtual void cancelMe();
0042 
0043 protected:
0044     svn::ContextP m_CurrentContext;
0045     svn::ClientP m_Svnclient;
0046     ThreadContextListener *m_SvnContextListener;
0047     QObject *m_Parent;
0048 
0049     //! a base method often needed
0050     /*!
0051      * Exceptions will NOT be caught, the caller has to do it!
0052      */
0053     void itemInfo(const QString &what,
0054                   svn::InfoEntry &target,
0055                   const svn::Revision &_rev = svn::Revision::UNDEFINED,
0056                   const svn::Revision &_peg = svn::Revision::UNDEFINED);
0057 };
0058 
0059 #endif