File indexing completed on 2024-04-28 05:42:09

0001 /*
0002  * Port for usage with qt-framework and development for kdesvn
0003  * Copyright (C) 2005-2009 by Rajko Albrecht (ral@alwins-world.de)
0004  * https://kde.org/applications/development/org.kde.kdesvn
0005  */
0006 /*
0007  * ====================================================================
0008  * Copyright (c) 2002-2005 The RapidSvn Group.  All rights reserved.
0009  * dev@rapidsvn.tigris.org
0010  *
0011  * This library is free software; you can redistribute it and/or
0012  * modify it under the terms of the GNU Lesser General Public
0013  * License as published by the Free Software Foundation; either
0014  * version 2.1 of the License, or (at your option) any later version.
0015  *
0016  * This library is distributed in the hope that it will be useful,
0017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0019  * Lesser General Public License for more details.
0020  *
0021  * You should have received a copy of the GNU Lesser General Public
0022  * License along with this library (in the file LGPL.txt); if not,
0023  * write to the Free Software Foundation, Inc., 51 Franklin St,
0024  * Fifth Floor, Boston, MA  02110-1301  USA
0025  *
0026  * This software consists of voluntary contributions made by many
0027  * individuals.  For exact contribution history, see the revision
0028  * history and logs, available at http://rapidsvn.tigris.org/.
0029  * ====================================================================
0030  */
0031 
0032 #include "context.h"
0033 
0034 // Apache Portable Runtime
0035 #include <apr_xlate.h>
0036 
0037 // Subversion api
0038 #include <svn_auth.h>
0039 #include <svn_config.h>
0040 #include <svn_subst.h>
0041 
0042 // svncpp
0043 #include "apr.h"
0044 #include "context_listener.h"
0045 #include "contextdata.h"
0046 
0047 namespace svn
0048 {
0049 Context::Context(const QString &configDir)
0050 {
0051     m = new ContextData(configDir);
0052 }
0053 
0054 Context::Context(const Context &src)
0055 {
0056     m = new ContextData(src.m->configDir());
0057     setLogin(src.getUsername(), src.getPassword());
0058 }
0059 
0060 Context::~Context()
0061 {
0062     delete m;
0063 }
0064 
0065 void Context::setAuthCache(bool value)
0066 {
0067     m->setAuthCache(value);
0068 }
0069 
0070 void Context::setLogin(const QString &username, const QString &password)
0071 {
0072     m->setLogin(username, password);
0073 }
0074 
0075 Context::operator svn_client_ctx_t *() const
0076 {
0077     return m->ctx();
0078 }
0079 
0080 svn_client_ctx_t *Context::ctx() const
0081 {
0082     return m->ctx();
0083 }
0084 
0085 void Context::setLogMessage(const QString &msg)
0086 {
0087     m->setLogMessage(msg);
0088 }
0089 
0090 const QString &Context::getUsername() const
0091 {
0092     return m->getUsername();
0093 }
0094 
0095 const QString &Context::getPassword() const
0096 {
0097     return m->getPassword();
0098 }
0099 
0100 const QString &Context::getLogMessage() const
0101 {
0102     return m->getLogMessage();
0103 }
0104 
0105 void Context::setListener(ContextListener *listener)
0106 {
0107     m->setListener(listener);
0108 }
0109 
0110 ContextListener *Context::getListener() const
0111 {
0112     return m->getListener();
0113 }
0114 
0115 void Context::reset()
0116 {
0117     m->reset();
0118 }
0119 
0120 bool Context::contextAddListItem(DirEntries *entries, const svn_dirent_t *dirent, const svn_lock_t *lock, const QString &path)
0121 {
0122     return m->contextAddListItem(entries, dirent, lock, path);
0123 }
0124 }
0125 
0126 /* -----------------------------------------------------------------
0127  * local variables:
0128  * eval: (load-file "../../rapidsvn-dev.el")
0129  * end:
0130  */