@ -189,8 +189,8 @@ bool KdesvnFileListPrivate::reReadSettings()
_unknown ! = mdisp_unknown_files ) ;
_unknown ! = mdisp_unknown_files ) ;
}
}
kdesvnfilelist : : kdesvnfilelist ( KActionCollection * aCollect , TQWidget * tq parent, const char * name )
kdesvnfilelist : : kdesvnfilelist ( KActionCollection * aCollect , TQWidget * parent, const char * name )
: KListView ( tq parent, name ) , ItemDisplay ( ) , m_SvnWrapper ( new SvnActions ( this ) )
: KListView ( parent, name ) , ItemDisplay ( ) , m_SvnWrapper ( new SvnActions ( this ) )
{
{
m_SelectedItems = 0 ;
m_SelectedItems = 0 ;
m_pList = new KdesvnFileListPrivate ;
m_pList = new KdesvnFileListPrivate ;
@ -646,7 +646,7 @@ void kdesvnfilelist::closeMe()
m_pList - > m_fileTip - > setItem ( 0 ) ;
m_pList - > m_fileTip - > setItem ( 0 ) ;
}
}
bool kdesvnfilelist : : checkDirs ( const TQString & _what , FileListViewItem * _ tq parent)
bool kdesvnfilelist : : checkDirs ( const TQString & _what , FileListViewItem * _ parent)
{
{
TQString what = _what ;
TQString what = _what ;
svn : : StatusEntries dlist ;
svn : : StatusEntries dlist ;
@ -654,13 +654,13 @@ bool kdesvnfilelist::checkDirs(const TQString&_what,FileListViewItem * _tqparent
what . truncate ( what . length ( ) - 1 ) ;
what . truncate ( what . length ( ) - 1 ) ;
}
}
// prevent this from checking unversioned folder. FIXME: what happen when we do open url on a non-working-copy folder??
// prevent this from checking unversioned folder. FIXME: what happen when we do open url on a non-working-copy folder??
if ( ! isWorkingCopy ( ) | | ( ! _ tq parent) | | ( ( _ tq parent) & & ( _ tq parent- > isVersioned ( ) ) ) ) {
if ( ! isWorkingCopy ( ) | | ( ! _ parent) | | ( ( _ parent) & & ( _ parent- > isVersioned ( ) ) ) ) {
if ( ! m_SvnWrapper - > maketqStatus ( what , dlist , m_pList - > m_remoteRevision ) ) {
if ( ! m_SvnWrapper - > maketqStatus ( what , dlist , m_pList - > m_remoteRevision ) ) {
kdDebug ( ) < < " unable maketqStatus " < < endl ;
kdDebug ( ) < < " unable maketqStatus " < < endl ;
return false ;
return false ;
}
}
} else {
} else {
checkUnversionedDirs ( _ tq parent) ;
checkUnversionedDirs ( _ parent) ;
return true ;
return true ;
}
}
svn : : StatusEntries neweritems ;
svn : : StatusEntries neweritems ;
@ -682,15 +682,15 @@ bool kdesvnfilelist::checkDirs(const TQString&_what,FileListViewItem * _tqparent
// current item is not versioned
// current item is not versioned
if ( ! ( * it ) - > isVersioned ( ) & & ! filterOut ( ( * it ) ) ) {
if ( ! ( * it ) - > isVersioned ( ) & & ! filterOut ( ( * it ) ) ) {
// if empty, we may want to create a default svn::tqStatus for each folder inside this _ tq parent
// if empty, we may want to create a default svn::tqStatus for each folder inside this _ parent
// iterate over TQDir and create new filelistviewitem
// iterate over TQDir and create new filelistviewitem
checkUnversionedDirs ( _ tq parent) ;
checkUnversionedDirs ( _ parent) ;
}
}
if ( ( * it ) - > path ( ) = = what | | TQString : : compare ( ( * it ) - > entry ( ) . url ( ) , what ) = = 0 ) {
if ( ( * it ) - > path ( ) = = what | | TQString : : compare ( ( * it ) - > entry ( ) . url ( ) , what ) = = 0 ) {
if ( ! _ tq parent) {
if ( ! _ parent) {
pitem = new FileListViewItem ( this , * it ) ;
pitem = new FileListViewItem ( this , * it ) ;
//kdDebug()<< "CheckDirs::creating new FileListViewitem as tq parent " + (*it)->path() << endl;
//kdDebug()<< "CheckDirs::creating new FileListViewitem as parent " + (*it)->path() << endl;
m_Dirsread [ pitem - > fullName ( ) ] = true ;
m_Dirsread [ pitem - > fullName ( ) ] = true ;
pitem - > setDropEnabled ( true ) ;
pitem - > setDropEnabled ( true ) ;
}
}
@ -699,8 +699,8 @@ bool kdesvnfilelist::checkDirs(const TQString&_what,FileListViewItem * _tqparent
break ;
break ;
}
}
}
}
if ( _ tq parent) {
if ( _ parent) {
pitem = _ tq parent;
pitem = _ parent;
}
}
insertDirs ( pitem , dlist ) ;
insertDirs ( pitem , dlist ) ;
if ( ownupdates ) {
if ( ownupdates ) {
@ -711,7 +711,7 @@ bool kdesvnfilelist::checkDirs(const TQString&_what,FileListViewItem * _tqparent
return true ;
return true ;
}
}
void kdesvnfilelist : : insertDirs ( FileListViewItem * _ tq parent, svn : : StatusEntries & dlist )
void kdesvnfilelist : : insertDirs ( FileListViewItem * _ parent, svn : : StatusEntries & dlist )
{
{
svn : : StatusEntries : : iterator it ;
svn : : StatusEntries : : iterator it ;
#if 0
#if 0
@ -732,13 +732,13 @@ void kdesvnfilelist::insertDirs(FileListViewItem * _tqparent,svn::StatusEntries&
continue ;
continue ;
}
}
FileListViewItem * item ;
FileListViewItem * item ;
if ( ! _ tq parent) {
if ( ! _ parent) {
item = new FileListViewItem ( this , * it ) ;
item = new FileListViewItem ( this , * it ) ;
} else {
} else {
if ( ( item = _ tq parent- > findChild ( ( * it ) - > path ( ) ) ) ) {
if ( ( item = _ parent- > findChild ( ( * it ) - > path ( ) ) ) ) {
delete item ;
delete item ;
}
}
item = new FileListViewItem ( this , _ tq parent, * it ) ;
item = new FileListViewItem ( this , _ parent, * it ) ;
}
}
if ( item - > isDir ( ) ) {
if ( item - > isDir ( ) ) {
m_Dirsread [ item - > fullName ( ) ] = false ;
m_Dirsread [ item - > fullName ( ) ] = false ;
@ -912,7 +912,7 @@ void kdesvnfilelist::enableActions()
m_DelCurrent - > setEnabled ( ( multi | | single ) ) ;
m_DelCurrent - > setEnabled ( ( multi | | single ) ) ;
m_LockAction - > setEnabled ( ( multi | | single ) ) ;
m_LockAction - > setEnabled ( ( multi | | single ) ) ;
m_UnlockAction - > setEnabled ( ( multi | | single ) ) ;
m_UnlockAction - > setEnabled ( ( multi | | single ) ) ;
m_IgnoreAction - > setEnabled ( ( single ) & & singleSelected ( ) - > tq parent( ) ! = 0 & & ! singleSelected ( ) - > isRealVersioned ( ) ) ;
m_IgnoreAction - > setEnabled ( ( single ) & & singleSelected ( ) - > parent( ) ! = 0 & & ! singleSelected ( ) - > isRealVersioned ( ) ) ;
m_RenameAction - > setEnabled ( single & & ( ! isWorkingCopy ( ) | | singleSelected ( ) ! = firstChild ( ) ) ) ;
m_RenameAction - > setEnabled ( single & & ( ! isWorkingCopy ( ) | | singleSelected ( ) ! = firstChild ( ) ) ) ;
m_CopyAction - > setEnabled ( single & & ( ! isWorkingCopy ( ) | | singleSelected ( ) ! = firstChild ( ) ) ) ;
m_CopyAction - > setEnabled ( single & & ( ! isWorkingCopy ( ) | | singleSelected ( ) ! = firstChild ( ) ) ) ;
@ -1304,11 +1304,11 @@ void kdesvnfilelist::refreshCurrent(SvnItem*cur)
viewport ( ) - > tqrepaint ( ) ;
viewport ( ) - > tqrepaint ( ) ;
}
}
bool kdesvnfilelist : : refreshRecursive ( FileListViewItem * _ tq parent, bool down )
bool kdesvnfilelist : : refreshRecursive ( FileListViewItem * _ parent, bool down )
{
{
FileListViewItem * item ;
FileListViewItem * item ;
if ( _ tq parent) {
if ( _ parent) {
item = static_cast < FileListViewItem * > ( _ tq parent- > firstChild ( ) ) ;
item = static_cast < FileListViewItem * > ( _ parent- > firstChild ( ) ) ;
} else {
} else {
item = static_cast < FileListViewItem * > ( firstChild ( ) ) ;
item = static_cast < FileListViewItem * > ( firstChild ( ) ) ;
}
}
@ -1324,7 +1324,7 @@ bool kdesvnfilelist::refreshRecursive(FileListViewItem*_tqparent,bool down)
item = static_cast < FileListViewItem * > ( item - > nextSibling ( ) ) ;
item = static_cast < FileListViewItem * > ( item - > nextSibling ( ) ) ;
}
}
TQString what = ( _ tq parent! = 0 ? _ tq parent- > fullName ( ) : baseUri ( ) ) ;
TQString what = ( _ parent! = 0 ? _ parent- > fullName ( ) : baseUri ( ) ) ;
svn : : StatusEntries dlist ;
svn : : StatusEntries dlist ;
if ( ! m_SvnWrapper - > maketqStatus ( what , dlist , m_pList - > m_remoteRevision ) ) {
if ( ! m_SvnWrapper - > maketqStatus ( what , dlist , m_pList - > m_remoteRevision ) ) {
@ -1363,10 +1363,10 @@ bool kdesvnfilelist::refreshRecursive(FileListViewItem*_tqparent,bool down)
if ( ! gotit & & ! filterOut ( ( * it ) ) ) {
if ( ! gotit & & ! filterOut ( ( * it ) ) ) {
dispchanged = true ;
dispchanged = true ;
FileListViewItem * item ;
FileListViewItem * item ;
if ( ! _ tq parent) {
if ( ! _ parent) {
item = new FileListViewItem ( this , * it ) ;
item = new FileListViewItem ( this , * it ) ;
} else {
} else {
item = new FileListViewItem ( this , _ tq parent, * it ) ;
item = new FileListViewItem ( this , _ parent, * it ) ;
}
}
if ( item - > isDir ( ) ) {
if ( item - > isDir ( ) ) {
m_Dirsread [ item - > fullName ( ) ] = false ;
m_Dirsread [ item - > fullName ( ) ] = false ;
@ -1400,8 +1400,8 @@ bool kdesvnfilelist::refreshRecursive(FileListViewItem*_tqparent,bool down)
kdDebug ( ) < < " Selected items " < < m_SelectedItems - > count ( ) < < endl ;
kdDebug ( ) < < " Selected items " < < m_SelectedItems - > count ( ) < < endl ;
# endif
# endif
}
}
if ( _ tq parent) {
if ( _ parent) {
item = static_cast < FileListViewItem * > ( _ tq parent- > firstChild ( ) ) ;
item = static_cast < FileListViewItem * > ( _ parent- > firstChild ( ) ) ;
} else {
} else {
item = static_cast < FileListViewItem * > ( firstChild ( ) ) ;
item = static_cast < FileListViewItem * > ( firstChild ( ) ) ;
}
}
@ -2486,8 +2486,8 @@ void kdesvnfilelist::slotDirItemCreated(const TQString&what)
void kdesvnfilelist : : updateParents ( FileListViewItem * item )
void kdesvnfilelist : : updateParents ( FileListViewItem * item )
{
{
if ( ! item | | ! item - > tq parent( ) ) return ;
if ( ! item | | ! item - > parent( ) ) return ;
FileListViewItem * it = static_cast < FileListViewItem * > ( item - > tq parent( ) ) ;
FileListViewItem * it = static_cast < FileListViewItem * > ( item - > parent( ) ) ;
it - > update ( ) ;
it - > update ( ) ;
updateParents ( it ) ;
updateParents ( it ) ;
}
}
@ -2564,7 +2564,7 @@ void kdesvnfilelist::_dirwatchTimeout()
checkUnversionedDirs ( item ) ;
checkUnversionedDirs ( item ) ;
}
}
}
}
updateParents ( static_cast < FileListViewItem * > ( item - > tq parent( ) ) ) ;
updateParents ( static_cast < FileListViewItem * > ( item - > parent( ) ) ) ;
} else if ( c = = ' D ' ) {
} else if ( c = = ' D ' ) {
if ( item - > isDir ( ) ) {
if ( item - > isDir ( ) ) {
m_pList - > m_DirWatch - > removeDir ( what ) ;
m_pList - > m_DirWatch - > removeDir ( what ) ;
@ -2576,7 +2576,7 @@ void kdesvnfilelist::_dirwatchTimeout()
} else if ( ! item - > isMissing ( ) ) {
} else if ( ! item - > isMissing ( ) ) {
TQFileInfo fi ( what ) ;
TQFileInfo fi ( what ) ;
if ( ! fi . exists ( ) ) {
if ( ! fi . exists ( ) ) {
FileListViewItem * p = static_cast < FileListViewItem * > ( item - > tq parent( ) ) ;
FileListViewItem * p = static_cast < FileListViewItem * > ( item - > parent( ) ) ;
delete item ;
delete item ;
repaintit = true ;
repaintit = true ;
item = 0 ;
item = 0 ;
@ -2804,11 +2804,11 @@ void kdesvnfilelist::slotRelocate()
refreshItem ( k - > fItem ( ) ) ;
refreshItem ( k - > fItem ( ) ) ;
}
}
void kdesvnfilelist : : checkUnversionedDirs ( FileListViewItem * _ tq parent )
void kdesvnfilelist : : checkUnversionedDirs ( FileListViewItem * _ parent )
{
{
TQDir d ;
TQDir d ;
if ( _ tq parent)
if ( _ parent)
d . setPath ( _ tq parent- > fullName ( ) ) ; //FIXME: this one is not reliable, what if _ tq parent == 0??
d . setPath ( _ parent- > fullName ( ) ) ; //FIXME: this one is not reliable, what if _ parent == 0??
// else
// else
// d.setPath(this->firstChild()->fullName());
// d.setPath(this->firstChild()->fullName());
@ -2845,12 +2845,12 @@ void kdesvnfilelist::checkUnversionedDirs( FileListViewItem * _tqparent )
// start copying insertDirs
// start copying insertDirs
FileListViewItem * item ;
FileListViewItem * item ;
if ( ! _ tq parent) {
if ( ! _ parent) {
item = new FileListViewItem ( this , stat ) ;
item = new FileListViewItem ( this , stat ) ;
kdDebug ( ) < < " creating new FileListViewitem " + item - > fullName ( ) < < endl ;
kdDebug ( ) < < " creating new FileListViewitem " + item - > fullName ( ) < < endl ;
} else {
} else {
item = new FileListViewItem ( this , _ tq parent, stat ) ;
item = new FileListViewItem ( this , _ parent, stat ) ;
kdDebug ( ) < < " creating new FileListViewitem (with tq parent) " + item - > fullName ( ) < < endl ;
kdDebug ( ) < < " creating new FileListViewitem (with parent) " + item - > fullName ( ) < < endl ;
}
}
if ( fi - > isDir ( ) ) {
if ( fi - > isDir ( ) ) {
m_Dirsread [ item - > fullName ( ) ] = false ;
m_Dirsread [ item - > fullName ( ) ] = false ;
@ -2872,7 +2872,7 @@ void kdesvnfilelist::checkUnversionedDirs( FileListViewItem * _tqparent )
}
}
// uncomment this if you've ben able to set svn_node_kind (see above)
// uncomment this if you've ben able to set svn_node_kind (see above)
//this->insertDirs(_ tq parent, nonversioned_list);
//this->insertDirs(_ parent, nonversioned_list);
}
}
void kdesvnfilelist : : rescanIconsRec ( FileListViewItem * startAt , bool checkNewer , bool no_update )
void kdesvnfilelist : : rescanIconsRec ( FileListViewItem * startAt , bool checkNewer , bool no_update )
@ -3098,7 +3098,7 @@ void kdesvnfilelist::slotFoldTree()
while ( TQListViewItem * item = it . current ( ) )
while ( TQListViewItem * item = it . current ( ) )
{
{
// don't close the top level directory
// don't close the top level directory
if ( item - > isExpandable ( ) & & item - > tq parent( ) )
if ( item - > isExpandable ( ) & & item - > parent( ) )
item - > setOpen ( false ) ;
item - > setOpen ( false ) ;
+ + it ;
+ + it ;