lib/interfaces/kdevvcsfileinfoprovider.cpp
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #include <kdevversioncontrol.h> 00021 #include "kdevvcsfileinfoprovider.h" 00022 00024 // struct VCSFileInfo 00026 00027 QString VCSFileInfo::toString() const 00028 { 00029 return "(" + fileName + ", " + workRevision + ", " + repoRevision + ", " + state2String( state ) + ")"; 00030 } 00031 00033 00034 QString VCSFileInfo::state2String( FileState state ) 00035 { 00036 switch (state) 00037 { 00038 case Added: return "added"; 00039 case Uptodate: return "up-to-date"; 00040 case Modified: return "modified"; 00041 case Conflict: return "conflict"; 00042 case Sticky: return "sticky"; 00043 case NeedsPatch: return "needs patch"; 00044 case NeedsCheckout: return "needs check-out"; 00045 case Directory: return "directory"; 00046 case Unknown: 00047 default: 00048 return "unknown"; 00049 } 00050 } 00051 00053 // struct KDevVCSFileInfoProvider::Private 00055 00056 struct KDevVCSFileInfoProvider::Private 00057 { 00058 Private( KDevVersionControl *owner ) : m_owner( owner ) {} 00059 00060 KDevVersionControl *m_owner; 00061 }; 00062 00064 // class KDevVCSFileInfoProvider 00066 00067 KDevVCSFileInfoProvider::KDevVCSFileInfoProvider( KDevVersionControl *parent, const char *name ) 00068 : QObject( parent, name ), d( 0 ) //d(new Private( parent )) 00069 { 00070 } 00071 00073 00074 KDevVCSFileInfoProvider::~KDevVCSFileInfoProvider() 00075 { 00076 // delete d; 00077 } 00078 00080 00081 KDevVersionControl *KDevVCSFileInfoProvider::owner() const 00082 { 00083 // return d->m_owner; 00084 return static_cast<KDevVersionControl *>( parent() ); 00085 } 00086 00087 #include "kdevvcsfileinfoprovider.moc" 00088