File indexing completed on 2024-05-12 17:16:23
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 * http://kdesvn.alwins-world.de 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 0066 Context::setAuthCache(bool value) 0067 { 0068 m->setAuthCache(value); 0069 } 0070 0071 void 0072 Context::setLogin(const QString &username, const QString &password) 0073 { 0074 m->setLogin(username, password); 0075 } 0076 0077 Context::operator svn_client_ctx_t *()const 0078 { 0079 return m->ctx(); 0080 } 0081 0082 svn_client_ctx_t * 0083 Context::ctx()const 0084 { 0085 return m->ctx(); 0086 } 0087 0088 void 0089 Context::setLogMessage(const QString &msg) 0090 { 0091 m->setLogMessage(msg); 0092 } 0093 0094 const QString & 0095 Context::getUsername() const 0096 { 0097 return m->getUsername(); 0098 } 0099 0100 const QString & 0101 Context::getPassword() const 0102 { 0103 return m->getPassword(); 0104 } 0105 0106 const QString & 0107 Context::getLogMessage() const 0108 { 0109 return m->getLogMessage(); 0110 } 0111 0112 void 0113 Context::setListener(ContextListener *listener) 0114 { 0115 m->setListener(listener); 0116 } 0117 0118 ContextListener * 0119 Context::getListener() const 0120 { 0121 return m->getListener(); 0122 } 0123 0124 void 0125 Context::reset() 0126 { 0127 m->reset(); 0128 } 0129 0130 bool Context::contextAddListItem(DirEntries *entries, const svn_dirent_t *dirent, const svn_lock_t *lock, const QString &path) 0131 { 0132 return m->contextAddListItem(entries, dirent, lock, path); 0133 } 0134 } 0135 0136 /* ----------------------------------------------------------------- 0137 * local variables: 0138 * eval: (load-file "../../rapidsvn-dev.el") 0139 * end: 0140 */