WIP: Implement TDE/tdebase#270 for tdelibs: Extend meaning of "Hidden" files. #163

Closed
VinceR wants to merge 6 commits from issue/270/tdelibs into master
VinceR commented 2 years ago
Collaborator

This pull request addresses the tdelibs portion - there will also be a separate and related pull request for tdebase.

The changes are based on proposed patch submitted in response to a KDE bug filed many years ago.

It should be noted that most of the changes are concerned with changing *DotFiles* to *HiddenFiles* in names. This look like the riskiest part.

The changes have been successfully tested in a test environment -- so far, so good.

TO-DO:

  • Move testing to a "real" (daily use) environment.
  • Complete & test related changes to tdebase/libkonq & tdebase/konqueror.
  • Create a user interface for editing associated configuration.
This pull request addresses the tdelibs portion - there will also be a separate and related pull request for tdebase. The changes are based on [proposed patch](https://bugsfiles.kde.org/attachment.cgi?id=10208) submitted in response to a [KDE bug](https://bugs.kde.org/show_bug.cgi?id=3212) filed many years ago. It should be noted that **most** of the changes are concerned with changing \*DotFiles\* to \*HiddenFiles\* in names. This look like the riskiest part. The changes have been successfully tested in a test environment -- so far, so good. TO-DO: * Move testing to a "real" (daily use) environment. * Complete & test related changes to tdebase/libkonq & tdebase/konqueror. * Create a user interface for editing associated configuration.
VinceR commented 2 years ago
Poster
Collaborator

This is a note to myself, no need for comments / review unless you want.

Test Case # 1: demonstrate use of multiple hidden file specifications on normal size directories.

Test Setup

  • Konqueror view mode: Detailed List View
  • HiddenFileSpec: *~,TEMP*,temp* (note that these are globs, not a regex's)
  • Location: a test user's home directory, in a chroot.

Results

Works correctly, with no apparent issues. Specifics using a more realistic home directory (mine) will be posted once I start doing some "no better test than production" testing:)

This is a note to myself, no need for comments / review unless you want. **Test Case # 1**: demonstrate use of multiple hidden file specifications on normal size directories. **Test Setup** * Konqueror view mode: Detailed List View * HiddenFileSpec: `*~,TEMP*,temp*` (note that these are globs, not a regex's) * Location: a test user's home directory, in a chroot. **Results** Works correctly, with no apparent issues. Specifics using a more realistic home directory (mine) will be posted once I start doing some "no better test than production" testing:)
VinceR commented 2 years ago
Poster
Collaborator

This is a note to myself, no need for comments / review unless you want.

Test Case # 2: demonstrate use of a single hidden file specification on large directory.

Test Setup

  • Konqueror view mode: Detailed List View
  • HiddenFileSpec: lib*
  • Location: /usr/lib64 (7160 hidden items + 320 non-hidden items), in a chroot.

Test Scenarios

  • Scenario 1a: "Show Hidden Files" checked, konqueror is run for first time. Result: works correctly without noticeable delay.
  • Scenario 1b: While konqueror is running, change "Show Hidden Files" from checked to unchecked. Result: works correctly without noticeable delay.
  • Scenario 2a: "Show Hidden Files" unchecked, konqueror is run for first time. Result: works correctly without noticeable delay.
  • Scenario 2b: While konqueror is running, change "Show Hidden Files" from unchecked to checked. Result: works correctly with significant (~20 second) delay.

Speculation

I do not think the delay in Scenario 2b is caused by any of the new code. In other words, I think that any directory with 7160 dotfiles + 320 non-dotfiles would manifest this problem currently.

Here is an excerpt from the code in tdelibs/tdeio/kdirlister.cpp, with my unsubstantiated comments:

if ( d->changes & HIDDEN_FILES )
{
  if ( d->isShowingHiddenFiles ) {
    addNewItem( *kit );
  }
  else {
    emit deleteItem( *kit );
   // This looks like it could be REALLY SLOW for large KDirLister structures
  }

I speculate that it would be more efficient to just initialize another KDirLister structure rather than trying all of these deletes on such a large list.

This is a note to myself, no need for comments / review unless you want. **Test Case # 2**: demonstrate use of a single hidden file specification on large directory. **Test Setup** * Konqueror view mode: Detailed List View * HiddenFileSpec: `lib*` * Location: `/usr/lib64` (7160 hidden items + 320 non-hidden items), in a chroot. **Test Scenarios** * **Scenario 1a**: "Show Hidden Files" checked, konqueror is run for first time. Result: works correctly without noticeable delay. * **Scenario 1b**: While konqueror is running, change "Show Hidden Files" from checked to unchecked. Result: works correctly without noticeable delay. * **Scenario 2a**: "Show Hidden Files" unchecked, konqueror is run for first time. Result: works correctly without noticeable delay. * **Scenario 2b**: While konqueror is running, change "Show Hidden Files" from unchecked to checked. Result: works correctly with **significant (~20 second) delay**. **Speculation** I do not think the delay in Scenario 2b is caused by any of the new code. In other words, I think that any directory with 7160 dotfiles + 320 non-dotfiles would manifest this problem currently. Here is an excerpt from the code in `tdelibs/tdeio/kdirlister.cpp`, with my unsubstantiated comments: ``` if ( d->changes & HIDDEN_FILES ) { if ( d->isShowingHiddenFiles ) { addNewItem( *kit ); } else { emit deleteItem( *kit ); // This looks like it could be REALLY SLOW for large KDirLister structures } ``` I speculate that it would be more efficient to just initialize another KDirLister structure rather than trying all of these deletes on such a large list.
VinceR commented 2 years ago
Poster
Collaborator

I do not think the delay in Scenario 2b is caused by any of the new code. In other words, I think that any directory with 7160 dotfiles + 320 non-dotfiles would manifest this problem currently.

I have confirmed this. This is limitation (or bug) in current KDirLister::emitChanges() and is not related to the PR.

>I do not think the delay in Scenario 2b is caused by any of the new code. In other words, I think that any directory with 7160 dotfiles + 320 non-dotfiles would manifest this problem currently. I have confirmed this. This is limitation (or bug) in current KDirLister::emitChanges() and is not related to the PR.
VinceR force-pushed issue/270/tdelibs from 69fbbb0163 to a30e487eac 2 years ago
VinceR added 1 commit 2 years ago
7cd3caffa5
Changed HiddenFileMatcher from a single application instance
VinceR added 1 commit 2 years ago
21c8de4d48
Removed an annoyance in Hidden_Files_Dialog: cursor will now
VinceR commented 2 years ago
Poster
Collaborator

While testing the commit from a couple of days ago, I ran into a problem wherein the Konqueror kfind plugin was blowing up on Close, whether or not any type of search had been activated. I thought the problem was related to the missing delete(matcher) (corrected in the latest commit) but that was not it.

What I discovered was that when one makes a change to a well-known object such as KDirLister, one should probably recompile everything that depends on it. My Gentoo system splits up the tdebase into multiple "applications", so I couldn't simply recompile a package called tdebase.

For me, the solution to this particular problem was rebuilding (in Gentoo speak) the trinity-base/kfind package which is part of tdebase. Other tdebase packages did not seem affected.

While testing the commit from a couple of days ago, I ran into a problem wherein the Konqueror `kfind` plugin was blowing up on `Close`, whether or not any type of search had been activated. I thought the problem was related to the missing `delete(matcher)` (corrected in the latest commit) but that was not it. What I discovered was that when one makes a change to a well-known object such as `KDirLister`, one should probably recompile everything that depends on it. My Gentoo system splits up the tdebase into multiple "applications", so I couldn't simply recompile a package called **tdebase**. For me, the solution to this particular problem was rebuilding (in Gentoo speak) the `trinity-base/kfind` package which is part of tdebase. Other tdebase packages did not seem affected.
VinceR closed this pull request 2 years ago
VinceR reopened this pull request 2 years ago
Owner

What I discovered was that when one makes a change to a well-known object such as KDirLister, one should probably recompile everything that depends on it.

There shouldn't be a need to recompile, unless you are changing static libraries. But it is probably recommended to logout and login again, to make sure the new libraries are used. I have seen similar issues when rebuilding "core" elements and a logout/login is a clean start.

> What I discovered was that when one makes a change to a well-known object such as KDirLister, one should probably recompile everything that depends on it. There shouldn't be a need to recompile, unless you are changing static libraries. But it is probably recommended to logout and login again, to make sure the new libraries are used. I have seen similar issues when rebuilding "core" elements and a logout/login is a clean start.
Owner

What I discovered was that when one makes a change to a well-known object such as KDirLister, one should probably recompile everything that depends on it.

There shouldn't be a need to recompile, unless you are changing static libraries. But it is probably recommended to logout and login again, to make sure the new libraries are used. I have seen similar issues when rebuilding "core" elements and a logout/login is a clean start.

It is always essential whether the patch represents a change in the public API/ABI or only internal. It should be kept in mind that the inline function defined in the header may manifest itself as a hidden API/ABI change. If the API/ABI is unchanged, then it should not require rebuild and should be sufficient logout/login, as mentioned by @MicheleC, or run /opt/trinity/bin/tdeinit.

> > What I discovered was that when one makes a change to a well-known object such as KDirLister, one should probably recompile everything that depends on it. > > There shouldn't be a need to recompile, unless you are changing static libraries. But it is probably recommended to logout and login again, to make sure the new libraries are used. I have seen similar issues when rebuilding "core" elements and a logout/login is a clean start. It is always essential whether the patch represents a change in the public API/ABI or only internal. It should be kept in mind that the inline function defined in the header may manifest itself as a hidden API/ABI change. If the API/ABI is unchanged, then it should not require rebuild and should be sufficient logout/login, as mentioned by @MicheleC, or run `/opt/trinity/bin/tdeinit`.
Owner

@VinceR
I will start reviewing and adding comments from tomorrow. It may take a few days to complete, due to my workload and some days off with family.
Again, apologies for the delay, July has been way too busy here.

@VinceR I will start reviewing and adding comments from tomorrow. It may take a few days to complete, due to my workload and some days off with family. Again, apologies for the delay, July has been way too busy here.
MicheleC reviewed 2 years ago
/**
* Pointer to object that encapsulates criteria for determining whether
* or not a file is "hidden". There is one such object per KDirlister.
Owner

KDirlister --> KDirLister 😉

KDirlister --> KDirLister :wink:
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
* whether or not an individual filesystem object is "hidden" by
* current matcher criteria.
*/
TDEIO::HiddenFileMatcher *matcher;
Owner

All internal members or KDirLister are collected inside the KDirListerPrivate class. Suggest we move the matcher there as well.

All internal members or KDirLister are collected inside the KDirListerPrivate class. Suggest we move the matcher there as well.
VinceR commented 2 years ago
Poster
Collaborator

All internal members or KDirLister are collected inside the KDirListerPrivate class. Suggest we move the matcher there as well.

"Outsiders" require access to KDirLister's TDEIO::HiddenFileMatcher object methods (see TDE/tdebase#273). Specifically in tdebase/konqueror/listview/:

  • konq_listview.cpp/KonqListView::KonqListView(...) calls the setCriteria() method to initialize matcher object with user's stored default match criteria.
  • konq_listview.cpp/KonqListView::slotChangeHiddenFileMatcher() calls the getMatchPropertiesFromUser() method to allow user to change match criteria, either for current running view or as default. It also calls the get_Criteria() method if updated criteria is to be saved as default.
  • konq_listviewitems.cpp/KonqListViewItem::updateContents() calls the match() method to determine if file is hidden when the "Group Hidden First" sort option is in effect.

Not sure we can do that if we hide the object in the private area. But that does beg a question that I posed somewhere inside the code: what are the reasons for storing properties (in this case a pointer) in an object's private structure versus in its declaration in a header file?

> All internal members or KDirLister are collected inside the KDirListerPrivate class. Suggest we move the matcher there as well. "Outsiders" require access to `KDirLister's TDEIO::HiddenFileMatcher` object methods (see https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/pulls/273). Specifically in `tdebase/konqueror/listview/`: * `konq_listview.cpp/KonqListView::KonqListView(...)` calls the `setCriteria()` method to initialize matcher object with user's stored default match criteria. * `konq_listview.cpp/KonqListView::slotChangeHiddenFileMatcher()` calls the `getMatchPropertiesFromUser()` method to allow user to change match criteria, either for current running view or as default. It also calls the `get_Criteria()` method if updated criteria is to be saved as default. * `konq_listviewitems.cpp/KonqListViewItem::updateContents()` calls the `match()` method to determine if file is hidden when the "Group Hidden First" sort option is in effect. Not sure we can do that if we hide the object in the private area. But that does beg a question that I posed somewhere inside the code: what are the reasons for storing properties (in this case a pointer) in an object's private structure versus in its declaration in a header file?
Owner

But that does beg a question that I posed somewhere inside the code: what are the reasons for storing properties (in this case a pointer) in an object's private structure versus in its declaration in a header file?

In TDE there is a convention to have a "private" class to store the internal details. This is I guess partly historical from KDE3 and partly to provide a cleaner interface, hiding the internal implementation.
After I complete reviewing the PR, I will provide more comments on your other questions above. Maybe we don't need to access the matcher directly from outside or maybe we find another way to do that.

> But that does beg a question that I posed somewhere inside the code: what are the reasons for storing properties (in this case a pointer) in an object's private structure versus in its declaration in a header file? In TDE there is a convention to have a "private" class to store the internal details. This is I guess partly historical from KDE3 and partly to provide a cleaner interface, hiding the internal implementation. After I complete reviewing the PR, I will provide more comments on your other questions above. Maybe we don't need to access the matcher directly from outside or maybe we find another way to do that.
Owner

We can add a matcher() method to KDirLister that exposes the underlined matcher object. This would be necessary anyway, because it is recommendable not to leave the object in the public part of the class. So it should be little effort to move the matcher in the private KDirListerPrivate class.

We can add a `matcher()` method to `KDirLister` that exposes the underlined matcher object. This would be necessary anyway, because it is recommendable not to leave the object in the public part of the class. So it should be little effort to move the matcher in the private `KDirListerPrivate` class.
MicheleC reviewed 2 years ago
d = new KDirListerPrivate;
matcher = new TDEIO::HiddenFileMatcher;
Owner

Suggest to move to KDirListerPrivate.

Suggest to move to KDirListerPrivate.
MicheleC reviewed 2 years ago
}
delete d;
delete matcher;
Owner

Suggest to move to KDirListerPrivate.

Suggest to move to KDirListerPrivate.
MicheleC reviewed 2 years ago
MicheleC reviewed 2 years ago
MicheleC reviewed 2 years ago
MicheleC reviewed 2 years ago
MicheleC reviewed 2 years ago
MicheleC reviewed 2 years ago
MicheleC reviewed 2 years ago
}
void KDirLister::setShowingDotFiles( bool _showDotFiles )
void KDirLister::setShowingHiddenFiles( bool _showHiddenFiles )
Owner

In the function declaration, the name of the parameter was changed to show. We should use the same name here for consistency, or change it in the declaration otherwise.

In the function declaration, the name of the parameter was changed to `show`. We should use the same name here for consistency, or change it in the declaration otherwise.
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
return false;
if ( !d->isShowingDotFiles && item->isHidden() )
const_cast<KFileItem*>(item)->setHidden( matcher );
Owner

I have not finished reviewing the whole PR, but I struggle to understand why this is needed here.

EDIT:
I think the way matcher is used with KFileItem can be improved. I will write more when I review that section. That would remove the need to call setHidden() here.

Moreover it calls a method that could modify item, which breaks the promise of the matchesFilter signature, where item is declared const.

I have not finished reviewing the whole PR, but I struggle to understand why this is needed here. EDIT: I think the way `matcher` is used with `KFileItem` can be improved. I will write more when I review that section. That would remove the need to call setHidden() here. Moreover it calls a method that could modify `item`, which breaks the promise of the `matchesFilter` signature, where `item` is declared const.
VinceR commented 2 years ago
Poster
Collaborator

I think the way matcher is used with KFileItem can be improved. I will write more when I review that section. That would remove the need to call setHidden() here.

See my response to your larger review below - we may be able to get rid of that function.

Moreover it calls a method that could modify item, which breaks the promise of the matchesFilter signature, where item is declared const.

It was the only way I could get it to work. I note numerous similar examples throughout tdelibs code where similar promises are broken ¯\(ツ)

As I use C++ more, I see things that I consider to be genuine improvements to C. How const is handled is not one of them :)

> I think the way `matcher` is used with `KFileItem` can be improved. I will write more when I review that section. That would remove the need to call setHidden() here. See my response to your larger review below - we may be able to get rid of that function. > Moreover it calls a method that could modify `item`, which breaks the promise of the `matchesFilter` signature, where `item` is declared const. It was the only way I could get it to work. I note numerous similar examples throughout tdelibs code where similar promises are broken ¯\\_(ツ)_/¯ As I use C++ more, I see things that I consider to be genuine improvements to C. How `const` is handled is not one of them :)
Owner

As discuss in the Conversation section, we should pass the matcher to isHidden() and remove setHidden()

As discuss in the `Conversation` section, we should pass the `matcher` to `isHidden()` and remove `setHidden()`
MicheleC reviewed 2 years ago
continue;
}
(*kit)->setHidden( matcher );
Owner

This should no longer be required when we improve the logic for the use of matcher

This should no longer be required when we improve the logic for the use of `matcher`
VinceR marked this conversation as resolved
Owner

The problem I see with the current use of matcher in KFileItem is that each time you want to see if a file is hidden (KFileItem::isHidden()), we first call KFileItem::SetHidden() to set the matcher and the property, which is not very clean.
I see two possible ways to improve this, depending on what we want to achieve.

  1. pass the matcher to KFileItem::isHidden() and determine if a file is hidden or not at that moment. This has the benefit to require less code changes (the whole m_bHiddenFile logic is not needed anymore), but has the drawback to require evaluation at each call of KFileItem::isHidden(), which possibly results in worse performances.
    The idea behind this solution is that KFileItem could be visible or hidden depending on the matcher in use, and we don't need to modify the KFileItem at all, regardless of the matcher in use

  2. if we don't want the overhead each time we call KFileItem::isHidden(), we can decide that a KFileItem is visible/hidden at the time it is created or when a matcher is modified. This requires modifying all KFileItems each time we create them or when we change the matcher (this also implies remembering all the KFileItem that we need to modify when we change a the matcher). It also means that we can't use different matchers on the same KFileItem object.

IMO, option 1 is a better design and pretty much what the original code was doing, although with a fixed rule to decide whether a file was visible or not. We would need to see if performances would be drastically affected or not, but I think it should not be much worse than before.

@VinceR, @SlavekB what is your opinion?

The problem I see with the current use of `matcher` in `KFileItem` is that each time you want to see if a file is hidden (`KFileItem::isHidden()`), we first call `KFileItem::SetHidden()` to set the matcher and the property, which is not very clean. I see two possible ways to improve this, depending on what we want to achieve. 1) pass the matcher to `KFileItem::isHidden()` and determine if a file is hidden or not at that moment. This has the benefit to require less code changes (the whole `m_bHiddenFile` logic is not needed anymore), but has the drawback to require evaluation at each call of `KFileItem::isHidden()`, which possibly results in worse performances. The idea behind this solution is that `KFileItem` could be visible or hidden depending on the matcher in use, and we don't need to modify the KFileItem at all, regardless of the matcher in use 2) if we don't want the overhead each time we call `KFileItem::isHidden()`, we can decide that a `KFileItem` is visible/hidden at the time it is created or when a `matcher` is modified. This requires modifying all KFileItems each time we create them or when we change the `matcher` (this also implies remembering all the KFileItem that we need to modify when we change a the matcher). It also means that we can't use different matchers on the same `KFileItem` object. IMO, option 1 is a better design and pretty much what the original code was doing, although with a fixed rule to decide whether a file was visible or not. We would need to see if performances would be drastically affected or not, but I think it should not be much worse than before. @VinceR, @SlavekB what is your opinion?
VinceR commented 2 years ago
Poster
Collaborator

The problem I see with the current use of matcher in KFileItem is that each time you want to see if a file is hidden (KFileItem::isHidden()), we first call KFileItem::SetHidden() to set the matcher and the property, which is not very clean.
I see two possible ways to improve this, depending on what we want to achieve.

  1. pass the matcher to KFileItem::isHidden() and determine if a file is hidden or not at that moment. This has the benefit to require less code changes (the whole m_bHiddenFile logic is not needed anymore), but has the drawback to require evaluation at each call of KFileItem::isHidden(), which possibly results in worse performances.
    The idea behind this solution is that KFileItem could be visible or hidden depending on the matcher in use, and we don't need to modify the KFileItem at all, regardless of the matcher in use

@VinceR, @SlavekB what is your opinion?

An earlier implementation did something like option 1. I now realize that there is probably no need for separate isHidden() and SetHidden() functions. BUT ... the problem I struggled with was the fact that isHidden() is being called from other places than within KDirLister code. I do think we still need m_bHiddenFile to remember a file's "hideability" for such function calls.

Would the following code address your concern? We would get rid of SetHidden() and call isHidden(matcher) within the KDirLister code

bool KFileItem::isHidden(TDEIO::HiddenFileMatcher *matcher = nullptr) const
{
  if ( matcher != nullptr ) {
    // Re-evaluate file's "hideability" using the passed matcher and record
    // that for future calls to this function where no matcher is passed
    if ( !m_url.isEmpty() )
      m_bHiddenFile = matcher->match( m_url.fileName() );
    else // should never happen
      m_bHiddenFile = matcher->match( m_strName );
  }

  if ( m_hidden != Auto )
      return m_hidden == Hidden;
  return m_bHiddenFile;

  /* FIXME: Who else calls this function? We see calls in these functions

     - tdeio/tdeio/kdirlister.cpp/KDirLister::emitChanges()
     - tdeio/tdeio/kdirlister.cpp/KDirLister::matchesFilter()
     
     but testing reveals that it is also being called elsewhere.
  */
}


> The problem I see with the current use of `matcher` in `KFileItem` is that each time you want to see if a file is hidden (`KFileItem::isHidden()`), we first call `KFileItem::SetHidden()` to set the matcher and the property, which is not very clean. > I see two possible ways to improve this, depending on what we want to achieve. > > 1) pass the matcher to `KFileItem::isHidden()` and determine if a file is hidden or not at that moment. This has the benefit to require less code changes (the whole `m_bHiddenFile` logic is not needed anymore), but has the drawback to require evaluation at each call of `KFileItem::isHidden()`, which possibly results in worse performances. > The idea behind this solution is that `KFileItem` could be visible or hidden depending on the matcher in use, and we don't need to modify the KFileItem at all, regardless of the matcher in use > > @VinceR, @SlavekB what is your opinion? An earlier implementation did something like option 1. I now realize that there is probably no need for separate `isHidden()` and `SetHidden()` functions. BUT ... the problem I struggled with was the fact that `isHidden()` is being called from other places than within KDirLister code. I do think we still need `m_bHiddenFile` to remember a file's "hideability" for such function calls. Would the following code address your concern? We would get rid of `SetHidden()` and call `isHidden(matcher)` within the KDirLister code ``` bool KFileItem::isHidden(TDEIO::HiddenFileMatcher *matcher = nullptr) const { if ( matcher != nullptr ) { // Re-evaluate file's "hideability" using the passed matcher and record // that for future calls to this function where no matcher is passed if ( !m_url.isEmpty() ) m_bHiddenFile = matcher->match( m_url.fileName() ); else // should never happen m_bHiddenFile = matcher->match( m_strName ); } if ( m_hidden != Auto ) return m_hidden == Hidden; return m_bHiddenFile; /* FIXME: Who else calls this function? We see calls in these functions - tdeio/tdeio/kdirlister.cpp/KDirLister::emitChanges() - tdeio/tdeio/kdirlister.cpp/KDirLister::matchesFilter() but testing reveals that it is also being called elsewhere. */ } ```
Owner

An earlier implementation did something like option 1. I now realize that there is probably no need for separate isHidden() and SetHidden() functions. BUT ... the problem I struggled with was the fact that isHidden() is being called from other places than within KDirLister code. I do think we still need m_bHiddenFile to remember a file's "hideability" for such function calls.

Hi @VinceR, sorry for the late reply, I was on a trip with the family for a few days.
I thought more about this and I am even more convinced that we should implement option 1. The first implementation in this PR does not perform any faster/better since setHidden is called whenever we want to call isHidden, so there would be no performance loss at all.

Would the following code address your concern? We would get rid of SetHidden() and call isHidden(matcher) within the KDirLister code

bool KFileItem::isHidden(TDEIO::HiddenFileMatcher *matcher = nullptr) const
{
  if ( matcher != nullptr ) {
    // Re-evaluate file's "hideability" using the passed matcher and record
    // that for future calls to this function where no matcher is passed
    if ( !m_url.isEmpty() )
      m_bHiddenFile = matcher->match( m_url.fileName() );
    else // should never happen
      m_bHiddenFile = matcher->match( m_strName );
  }

  if ( m_hidden != Auto )
      return m_hidden == Hidden;
  return m_bHiddenFile;

  /* FIXME: Who else calls this function? We see calls in these functions

     - tdeio/tdeio/kdirlister.cpp/KDirLister::emitChanges()
     - tdeio/tdeio/kdirlister.cpp/KDirLister::matchesFilter()
     
     but testing reveals that it is also being called elsewhere.
  */
}

Pretty good, just a couple of improvements.

  1. I don't think we need m_bHiddenFile at all, we can simply evaluate on the spot whether a file is hidden.
  2. We should abide by any choice that was made with m_hidden first.
  3. the FIXME comment is not necessary and likely to become outdated as soon as the call is used in any other part of TDE. If it was jsut to discuss a topic in this PR, we can do a search through the code and discuss it here :-)
  4. I am doubtful whether to use a default value for matcher because it would provide a "false" result. I think better to provide a matcher whenever we want to use this functionality. What do you think? If we keep the default nullptr value, we should probably provide the original logic based on the filename as a result for the time when no matcher is provided.

Basically a logic similar to the original code, but where the part related to the hidden test is replaced with the call to the matcher.
If we use m_bHiddenFile, we would have to

bool KFileItem::isHidden(TDEIO::HiddenFileMatcher *matcher) const
{
  if ( m_hidden != Auto )
      return m_hidden == Hidden;
  
  // Evaluate file's "hideability" using the passed matcher
  if ( !m_url.isEmpty() )
    return matcher->match( m_url.fileName() );
  else // should never happen
    return matcher->match( m_strName );
}

In the next 2 or 3 days I should have enough time to complete the review of this PR. Will likely add some more comments.

> An earlier implementation did something like option 1. I now realize that there is probably no need for separate `isHidden()` and `SetHidden()` functions. BUT ... the problem I struggled with was the fact that `isHidden()` is being called from other places than within KDirLister code. I do think we still need `m_bHiddenFile` to remember a file's "hideability" for such function calls. Hi @VinceR, sorry for the late reply, I was on a trip with the family for a few days. I thought more about this and I am even more convinced that we should implement option 1. The first implementation in this PR does not perform any faster/better since `setHidden` is called whenever we want to call `isHidden`, so there would be no performance loss at all. > Would the following code address your concern? We would get rid of `SetHidden()` and call `isHidden(matcher)` within the KDirLister code > > ``` > bool KFileItem::isHidden(TDEIO::HiddenFileMatcher *matcher = nullptr) const > { > if ( matcher != nullptr ) { > // Re-evaluate file's "hideability" using the passed matcher and record > // that for future calls to this function where no matcher is passed > if ( !m_url.isEmpty() ) > m_bHiddenFile = matcher->match( m_url.fileName() ); > else // should never happen > m_bHiddenFile = matcher->match( m_strName ); > } > > if ( m_hidden != Auto ) > return m_hidden == Hidden; > return m_bHiddenFile; > > /* FIXME: Who else calls this function? We see calls in these functions > > - tdeio/tdeio/kdirlister.cpp/KDirLister::emitChanges() > - tdeio/tdeio/kdirlister.cpp/KDirLister::matchesFilter() > > but testing reveals that it is also being called elsewhere. > */ > } > Pretty good, just a couple of improvements. 1) I don't think we need `m_bHiddenFile` at all, we can simply evaluate on the spot whether a file is hidden. 2) We should abide by any choice that was made with m_hidden first. 3) the FIXME comment is not necessary and likely to become outdated as soon as the call is used in any other part of TDE. If it was jsut to discuss a topic in this PR, we can do a search through the code and discuss it here :-) 4) I am doubtful whether to use a default value for `matcher` because it would provide a "false" result. I think better to provide a matcher whenever we want to use this functionality. What do you think? If we keep the default `nullptr` value, we should probably provide the original logic based on the filename as a result for the time when no matcher is provided. Basically a logic similar to the original code, but where the part related to the hidden test is replaced with the call to the matcher. If we use `m_bHiddenFile`, we would have to ``` bool KFileItem::isHidden(TDEIO::HiddenFileMatcher *matcher) const { if ( m_hidden != Auto ) return m_hidden == Hidden; // Evaluate file's "hideability" using the passed matcher if ( !m_url.isEmpty() ) return matcher->match( m_url.fileName() ); else // should never happen return matcher->match( m_strName ); } ``` In the next 2 or 3 days I should have enough time to complete the review of this PR. Will likely add some more comments.
VinceR commented 2 years ago
Poster
Collaborator

To clarify why I think there is a need for property KFileItem::m_bHiddenFile:

As you can see, my KFileItem::isHidden(matcher) code uses this property to cache the most recent result of matcher->match(...). Why do that? Because there are other callers of this function that do NOT pass a TDEIO::HiddenFileMatcher object to it. Property m_bHiddenFile is for their benefit.

Options for handling these callers are as follows:

  1. Modify the callers to pass, directly or indirectly, an associated KDirLister::match object to KFileItem::isHidden(). That won't work in code that has no relationship to or visibility into an associated KDirLister.
  2. Handle those callers by returning the result of the most recently cached call to the matcher. If the KFileItem object was not created by a KDirLister object, then return false . This is what I am proposing to do.
  3. Return FALSE meaning no file will be hidden. I think that would be preferable to the next option.
  4. Return a value based on the legacy dotfile test.

Here are the calls to KFileItem::isHidden() in tdelibs and tdebase that I was able to detect:

tdelibs/tdeio/tdeio/tdefileitem.cpp/KFileItem::overlays() which called by:
  tdelibs/tdeio/tdefile/tdefileiconview.cpp/KFileIconView::gotPreview(...)
  tdebase/libkonq/konq_iconviewwidget.cpp/KonqIconViewWidget::slotPreview(...)

The code appears to only be concerned with applying transparency to icons for hidden files. There is undoubtedly a KDirLister involved somewhere but I didn't see any obvious way to get access to it. But there would be no need to do any code modifications with my preferred option 2 -- the meaning of "hidden" will always be current. Or we could go for option 3 and abandon the icon transparency feature. Not being a big IconView user, I could live with that :)

tdelibs/tdeio/tdeio/tdefilefilter.cpp/KSimpleFileFilter::passesFilter(...)

I could not find any users of the KSimpleFileFilter class. Maybe that code could be amended to add and implement its own TDEIO::HiddenFileMatcher *matcher property as was done in with KDirLister. We could do that.

tdebase/tdeioslave/trash/testtrash.cpp/TestTrash::stat*()
# 5 functions, executing this:
  assert( !item.isHidden() );

Test trash program that doesn't get compiled, hmm. Anyway, with no KDirLister, the assertion should always succeed.


Of course, there might be calls to KFileItem::isHidden() in other parts of the TDE codebase.

To clarify why I think there is a need for property `KFileItem::m_bHiddenFile`: As you can see, my `KFileItem::isHidden(matcher)` code uses this property to cache the most recent result of `matcher->match(...)`. Why do that? Because there are other callers of this function that do **NOT** pass a `TDEIO::HiddenFileMatcher` object to it. Property `m_bHiddenFile` is for their benefit. Options for handling these callers are as follows: 1. Modify the callers to pass, directly or indirectly, an associated `KDirLister::match` object to `KFileItem::isHidden()`. That won't work in code that has no relationship to or visibility into an associated `KDirLister`. 1. Handle those callers by returning the result of the most recently cached call to the matcher. If the `KFileItem` object was **not** created by a `KDirLister` object, then return false . *This is what I am proposing to do*. 1. Return FALSE meaning no file will be hidden. I think that would be preferable to the next option. 1. Return a value based on the legacy dotfile test. ----- Here are the calls to `KFileItem::isHidden()` in tdelibs and tdebase that I was able to detect: ``` tdelibs/tdeio/tdeio/tdefileitem.cpp/KFileItem::overlays() which called by: tdelibs/tdeio/tdefile/tdefileiconview.cpp/KFileIconView::gotPreview(...) tdebase/libkonq/konq_iconviewwidget.cpp/KonqIconViewWidget::slotPreview(...) ``` The code appears to only be concerned with applying transparency to icons for hidden files. There is undoubtedly a `KDirLister` involved somewhere but I didn't see any obvious way to get access to it. But there would be no need to do any code modifications with my preferred option 2 -- the meaning of "hidden" will always be current. Or we could go for option 3 and abandon the icon transparency feature. Not being a big IconView user, I could live with that :) ``` tdelibs/tdeio/tdeio/tdefilefilter.cpp/KSimpleFileFilter::passesFilter(...) ``` I could not find any users of the `KSimpleFileFilter` class. Maybe that code could be amended to add and implement its own `TDEIO::HiddenFileMatcher *matcher` property as was done in with `KDirLister`. We could do that. ``` tdebase/tdeioslave/trash/testtrash.cpp/TestTrash::stat*() # 5 functions, executing this: assert( !item.isHidden() ); ``` Test trash program that doesn't get compiled, hmm. Anyway, with no `KDirLister`, the assertion should always succeed. ----- Of course, there might be calls to `KFileItem::isHidden()` in other parts of the TDE codebase.
Owner

Hi @VinceR

As you can see, my KFileItem::isHidden(matcher) code uses this property to cache the most recent result of matcher->match(...). Why do that? Because there are other callers of this function that do NOT pass a TDEIO::HiddenFileMatcher object to it. Property m_bHiddenFile is for their benefit.

It is a very valid point and it raises two important questions.

  1. How should we handle things from a global perspective?
  2. How to set a global matcher?

The more I think about the functionality we are trying to implement, the more I see a need to have the following things (some of which is already in this PR):

a. a global matcher, used as default when no matcher is specified. By default this should match dot files as the original code. I think using m_bHiddenFile makes sense in this context to improve performances across repeated calls.
b. a way to edit the global matcher (a dialog like the one in this PR - which I have not review yet btw). Changes would have global effect across TDE whenever the global matcher is used or when no matcher is used
c. a way to specify a custom matcher for a local application. This overrides the default matcher for the specific instance: for example we may want to use a different matcher in a Konqueror window or tab. This point implies having the ability to switch between global (default) matcher and custom matcher
d. a way to edit a custom matcher

I shall also discuss with @SlavekB when he is back from his trip early next week, but I am also interested in what you think about it.

In term of implementation, we can probably aim at implementing a. and b. first (I guess this PR does most of the job already) and later look at adding support for c. and d.

What do you think?

Hi @VinceR > As you can see, my KFileItem::isHidden(matcher) code uses this property to cache the most recent result of matcher->match(...). Why do that? Because there are other callers of this function that do NOT pass a TDEIO::HiddenFileMatcher object to it. Property m_bHiddenFile is for their benefit. It is a very valid point and it raises two important questions. 1. How should we handle things from a global perspective? 2. How to set a global matcher? The more I think about the functionality we are trying to implement, the more I see a need to have the following things (some of which is already in this PR): a. a global matcher, used as default when no matcher is specified. By default this should match dot files as the original code. I think using `m_bHiddenFile` makes sense in this context to improve performances across repeated calls. b. a way to edit the global matcher (a dialog like the one in this PR - which I have not review yet btw). Changes would have global effect across TDE whenever the global matcher is used or when no matcher is used c. a way to specify a custom matcher for a local application. This overrides the default matcher for the specific instance: for example we may want to use a different matcher in a Konqueror window or tab. This point implies having the ability to switch between global (default) matcher and custom matcher d. a way to edit a custom matcher I shall also discuss with @SlavekB when he is back from his trip early next week, but I am also interested in what you think about it. In term of implementation, we can probably aim at implementing a. and b. first (I guess this PR does most of the job already) and later look at adding support for c. and d. What do you think?
VinceR commented 2 years ago
Poster
Collaborator

Hi @VinceR

As you can see, my KFileItem::isHidden(matcher) code uses this property to cache the most recent result of matcher->match(...). Why do that? Because there are other callers of this function that do NOT pass a TDEIO::HiddenFileMatcher object to it. Property m_bHiddenFile is for their benefit.

It is a very valid point and it raises two important questions.

  1. How should we handle things from a global perspective?
  2. How to set a global matcher?

The more I think about the functionality we are trying to implement, the more I see a need to have the following things (some of which is already in this PR):

a. a global matcher, used as default when no matcher is specified. By default this should match dot files as the original code. I think using m_bHiddenFile makes sense in this context to improve performances across repeated calls.
b. a way to edit the global matcher (a dialog like the one in this PR - which I have not review yet btw). Changes would have global effect across TDE whenever the global matcher is used or when no matcher is used
c. a way to specify a custom matcher for a local application. This overrides the default matcher for the specific instance: for example we may want to use a different matcher in a Konqueror window or tab. This point implies having the ability to switch between global (default) matcher and custom matcher
d. a way to edit a custom matcher

I shall also discuss with @SlavekB when he is back from his trip early next week, but I am also interested in what you think about it.

In term of implementation, we can probably aim at implementing a. and b. first (I guess this PR does most of the job already) and later look at adding support for c. and d.

What do you think?

@MicheleC

I think most of those requirements may already be satisfied.

  1. A TDEIO::HiddenFileMatcher object always initializes to matching dotfiles on creation.
  2. Any application can allocate and use its own TDEIO::HiddenFileMatcher object. It just needs to store / retrieve its application-specific match criteria string as a separate application-specific setting on disk. This PR is doing just that for a KonqListView paired with an associated KDirLister.
  3. There is no reason why a global application-agnostic TDEIO::HiddenFileMatcher couldn't be allocated and used. The match criteria would be stored in a kdeglobals setting and modified by user through a control panel applet. The global defaults would be available by either using the global instance directly, or by initializing an application-specific matcher from the kdeglobals setting.
  4. In fact, an earlier incarnation of my code did use single global matcher. I'll put together an example of how it might be implemented using the existing code.
> Hi @VinceR > > > As you can see, my KFileItem::isHidden(matcher) code uses this property to cache the most recent result of matcher->match(...). Why do that? Because there are other callers of this function that do NOT pass a TDEIO::HiddenFileMatcher object to it. Property m_bHiddenFile is for their benefit. > > It is a very valid point and it raises two important questions. > > 1. How should we handle things from a global perspective? > 2. How to set a global matcher? > > The more I think about the functionality we are trying to implement, the more I see a need to have the following things (some of which is already in this PR): > > a. a global matcher, used as default when no matcher is specified. By default this should match dot files as the original code. I think using `m_bHiddenFile` makes sense in this context to improve performances across repeated calls. > b. a way to edit the global matcher (a dialog like the one in this PR - which I have not review yet btw). Changes would have global effect across TDE whenever the global matcher is used or when no matcher is used > c. a way to specify a custom matcher for a local application. This overrides the default matcher for the specific instance: for example we may want to use a different matcher in a Konqueror window or tab. This point implies having the ability to switch between global (default) matcher and custom matcher > d. a way to edit a custom matcher > > I shall also discuss with @SlavekB when he is back from his trip early next week, but I am also interested in what you think about it. > > In term of implementation, we can probably aim at implementing a. and b. first (I guess this PR does most of the job already) and later look at adding support for c. and d. > > What do you think? @MicheleC I think most of those requirements may already be satisfied. 1. A `TDEIO::HiddenFileMatcher` object always initializes to matching dotfiles on creation. 2. Any application can allocate and use its own `TDEIO::HiddenFileMatcher` object. It just needs to store / retrieve its application-specific match criteria string as a separate application-specific setting on disk. This PR is doing just that for a `KonqListView` paired with an associated `KDirLister`. 3. There is no reason why a global application-agnostic `TDEIO::HiddenFileMatcher` couldn't be allocated and used. The match criteria would be stored in a kdeglobals setting and modified by user through a control panel applet. The global defaults would be available by either using the global instance directly, or by initializing an application-specific matcher from the kdeglobals setting. 4. In fact, an earlier incarnation of my code did use single global matcher. I'll put together an example of how it might be implemented using the existing code.
Owner

Yes, a global file matcher with settings in stored in kdeglobals is definetely good. Then we need to have a way to edit that from the TDE control panel.
For the application-specific (but even for the view-specific, think different tabs wanting to use different matchers) we will also need to provide a way to set them from a GUI. But this can come later.

Yes, a global file matcher with settings in stored in kdeglobals is definetely good. Then we need to have a way to edit that from the TDE control panel. For the application-specific (but even for the view-specific, think different tabs wanting to use different matchers) we will also need to provide a way to set them from a GUI. But this can come later.
MicheleC reviewed 2 years ago
virtual void setFilterDotFiles( bool filter );
virtual void setFilterHiddenFiles( bool filter );
/**
* Checks whether filtering dot files is enabled.
Owner

filtering dot files should change into filtering hidden files

`filtering dot files` should change into `filtering hidden files`
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
* This option is enabled by default.
* @param filter true to enable filtering dot files, false to
Owner

filtering dot files should change into filtering hidden files

`filtering dot files` should change into `filtering hidden files`
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
}
(*kit)->setHidden( matcher );
if ( (*kit)->isHidden() )
Owner

As discuss in the Conversation section, we should pass the matcher to isHidden() and remove setHidden()

As discuss in the `Conversation` section, we should pass the `matcher` to `isHidden()` and remove `setHidden()`
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
by the HiddenFileMatcher standards pointed to by @param matcher.
Sets @property m_bHiddenFile accordingly.
*/
void setHidden( TDEIO::HiddenFileMatcher *matcher );
Owner

As discuss in the Conversation section, we should pass the matcher to isHidden() and remove setHidden().

As discuss in the `Conversation` section, we should pass the `matcher` to `isHidden()` and remove `setHidden()`.
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
*/
bool isHidden() const;
Owner

This method signature should remain as is.
A new bool isHidden(const TDEIO::HiddenFileMatcher *matcher); method should be added (note that there isn't a const at the end of the signature). This will implement what we discussed in the Conversation section: cache the value of m_bHiddenFile and return it. If a nullptr matcher is passed, the global matcher object should be used.

This method signature should remain as is. A new `bool isHidden(const TDEIO::HiddenFileMatcher *matcher);` method should be added (note that there isn't a `const` at the end of the signature). This will implement what we discussed in the `Conversation` section: cache the value of `m_bHiddenFile` and return it. If a nullptr matcher is passed, the global matcher object should be used.
VinceR commented 2 years ago
Poster
Collaborator

Hi @MicheleC,

I have some questions about this. Before your latest suggestions, here is what I had changed in tdeio/tdeio/fileitem.h per earlier discussion:

  mutable bool m_bHiddenFile:1;
  bool isHidden( TDEIO::HiddenFileMatcher *matcher = nullptr ) const;

This handled calling isHidden() and isHidden(matcher).
If I understand you correctly, you are suggesting something like this:

  bool m_bHiddenFile:1;
  bool isHidden() const;
  bool isHidden( TDEIO::HiddenFileMatcher *matcher);

I can do that but I guess I don't understand why it is better. Would we also need two function definitions in fileitem.cpp?


If a nullptr matcher is passed, the global matcher object should be used.

If we do this, we will be forcing the overlay() function, which calls isHidden(), to always use the global definition of hidden instead of the potentially different one that current KDirLister uses.

But your suggestion does nicely handle all of those potential calls to isHidden() that we do not yet know about. I guess that would be preferable in the long run.

Hi @MicheleC, I have some questions about this. Before your latest suggestions, here is what I had changed in tdeio/tdeio/fileitem.h per earlier discussion: ``` mutable bool m_bHiddenFile:1; bool isHidden( TDEIO::HiddenFileMatcher *matcher = nullptr ) const; ``` This handled calling `isHidden()` and `isHidden(matcher)`. If I understand you correctly, you are suggesting something like this: ``` bool m_bHiddenFile:1; bool isHidden() const; bool isHidden( TDEIO::HiddenFileMatcher *matcher); ``` I can do that but I guess I don't understand why it is better. Would we also need **two** function definitions in fileitem.cpp? ----- >> If a nullptr matcher is passed, the global matcher object should be used. If we do this, we will be forcing the `overlay()` function, which calls `isHidden()`, to always use the global definition of hidden instead of the potentially different one that current KDirLister uses. But your suggestion does nicely handle all of those potential calls to `isHidden()` that we do not yet know about. I guess that would be preferable in the long run.
Owner

Hi @VinceR

I can do that but I guess I don't understand why it is better.

It's a subtle thing, but it is a cleaner design.
The first function bool isHidden() const; is marked const, so it means it won't make any changes to the called object.
The second function bool isHidden( TDEIO::HiddenFileMatcher *matcher); is not marked const, so it is free to change the underlined object (that is to update the m_bHiddenFile flag).

Re using mutable, it is something I personally stay away from: IMO something is wrong in the design if we need to use mutable. IMO mutable is a bad concept in itself and should not even be part of the language. Happy to be proven wrong if anyone has a good use case for it :-)

Would we also need two function definitions in fileitem.cpp?

Yes, but basically we already have them. The original setHidden becomes the second isHidden ;-)

If we do this, we will be forcing the overlay() function, which calls isHidden(), to always use the global definition of hidden instead of the potentially different one that current KDirLister uses.

Not really. By calling isHidden() without a matcher, it will return the current cached status of `m_bHiddenFile', so if we change the matcher somewhere else, we would be able to use a custom matcher if needed. That is another benefit of having the two functions above.

Hi @VinceR > I can do that but I guess I don't understand why it is better. It's a subtle thing, but it is a cleaner design. The first function `bool isHidden() const;` is marked `const`, so it means it won't make any changes to the called object. The second function `bool isHidden( TDEIO::HiddenFileMatcher *matcher);` is not marked `const`, so it is free to change the underlined object (that is to update the `m_bHiddenFile` flag). Re using `mutable`, it is something I personally stay away from: IMO something is wrong in the design if we need to use `mutable`. IMO `mutable` is a bad concept in itself and should not even be part of the language. Happy to be proven wrong if anyone has a good use case for it :-) > Would we also need two function definitions in fileitem.cpp? Yes, but basically we already have them. The original `setHidden` becomes the second `isHidden` ;-) > If we do this, we will be forcing the overlay() function, which calls isHidden(), to always use the global definition of hidden instead of the potentially different one that current KDirLister uses. Not really. By calling `isHidden()` without a matcher, it will return the current cached status of `m_bHiddenFile', so if we change the matcher somewhere else, we would be able to use a custom matcher if needed. That is another benefit of having the two functions above.
VinceR commented 2 years ago
Poster
Collaborator

Doing things the way you suggest results in compile error:

kdirlister.cpp: In member function ‘virtual bool KDirLister::matchesFilter(const KFileItem*) const’: error: passing ‘const KFileItem’ as ‘this’ argument discards qualifiers

To work around this, I changed the function to call const_cast<KFileItem*>(item)->isHidden( matcher ) instead of item->isHidden( matcher ). But I do remember an earlier objection:

Moreover it calls a method that could modify item, which breaks the promise of the matchesFilter signature, where item is declared const.

It looks like we either need to use mutable or const_cast to change a property in an otherwise constant KFileItem.

I will be going with const_cast in the next commit, we can discuss this further after that.

Doing things the way you suggest results in compile error: ` kdirlister.cpp: In member function ‘virtual bool KDirLister::matchesFilter(const KFileItem*) const’: error: passing ‘const KFileItem’ as ‘this’ argument discards qualifiers ` To work around this, I changed the function to call `const_cast<KFileItem*>(item)->isHidden( matcher )` instead of `item->isHidden( matcher )`. But I do remember an earlier objection: > Moreover it calls a method that could modify item, which breaks the promise of the `matchesFilter` signature, where item is declared const. It looks like we either need to use `mutable` or `const_cast` to change a property in an otherwise constant `KFileItem`. I will be going with `const_cast` in the next commit, we can discuss this further after that.
Owner

Yeah, let's go for const_cast for the time being, then after you have pushed the next commit, we can review. If it makes sense, we may take away the 'const' from the parameter of the 'matchesFilter' call.
Will wait for the new code and then I will continue the review.

Yeah, let's go for const_cast for the time being, then after you have pushed the next commit, we can review. If it makes sense, we may take away the 'const' from the parameter of the 'matchesFilter' call. Will wait for the new code and then I will continue the review.
Owner

Hi @MicheleC,

I have some questions about this. Before your latest suggestions, here is what I had changed in tdeio/tdeio/fileitem.h per earlier discussion:

  mutable bool m_bHiddenFile:1;
  bool isHidden( TDEIO::HiddenFileMatcher *matcher = nullptr ) const;

This handled calling isHidden() and isHidden(matcher).
If I understand you correctly, you are suggesting something like this:

  bool m_bHiddenFile:1;
  bool isHidden() const;
  bool isHidden( TDEIO::HiddenFileMatcher *matcher);

I can do that but I guess I don't understand why it is better. Would we also need two function definitions in fileitem.cpp?

There is one more important fact: If the change would be made the first way – one method with the default value, this will cause immediate breaking of the ABI compatibility and will require rebuild almost everything. While the change made the second way – that is, two methods, it retains compatibility with the existing ABI and smoothly adds new functionality.

> Hi @MicheleC, > > I have some questions about this. Before your latest suggestions, here is what I had changed in tdeio/tdeio/fileitem.h per earlier discussion: > ``` > mutable bool m_bHiddenFile:1; > bool isHidden( TDEIO::HiddenFileMatcher *matcher = nullptr ) const; > ``` > This handled calling `isHidden()` and `isHidden(matcher)`. > If I understand you correctly, you are suggesting something like this: > ``` > bool m_bHiddenFile:1; > bool isHidden() const; > bool isHidden( TDEIO::HiddenFileMatcher *matcher); > ``` > I can do that but I guess I don't understand why it is better. Would we also need **two** function definitions in fileitem.cpp? > There is one more important fact: If the change would be made the first way – one method with the default value, this will cause immediate breaking of the ABI compatibility and will require rebuild almost everything. While the change made the second way – that is, two methods, it retains compatibility with the existing ABI and smoothly adds new functionality.
VinceR commented 2 years ago
Poster
Collaborator

There is one more important fact: If the change would be made the first way – one method with the default value, this will cause immediate breaking of the ABI compatibility and will require rebuild almost everything. While the change made the second way – that is, two methods, it retains compatibility with the existing ABI and smoothly adds new functionality.

I had to think about this for a bit but now I understand the reason why you are right. Thanks for this insight, I will try to avoid ABI incompatibilities in the future :)

>There is one more important fact: If the change would be made the first way – one method with the default value, this will cause immediate breaking of the ABI compatibility and will require rebuild almost everything. While the change made the second way – that is, two methods, it retains compatibility with the existing ABI and smoothly adds new functionality. I had to think about this for a bit but now I understand the reason why you are right. Thanks for this insight, I will try to avoid ABI incompatibilities in the future :)
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
&& !isReadable())
_state |= TDEIcon::LockOverlay;
// kdWarning() << "KFileItem::overlays calling isHidden()" << endl;
Owner

For consistency with the code around it, we can probably remove this comment

For consistency with the code around it, we can probably remove this comment
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
return m_url.fileName()[0] == '.';
else // should never happen
return m_strName[0] == '.';
/* FIXME: Who calls this function? We are aware of the following callers:
Owner

Unnecessary comment

Unnecessary comment
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
}
void KFileItem::setHidden( TDEIO::HiddenFileMatcher *matcher )
Owner

Change into bool KFileItem::isHidden(const TDEIO::HiddenFileMatcher *matcher)

Change into `bool KFileItem::isHidden(const TDEIO::HiddenFileMatcher *matcher)`
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
*/
bool m_bHiddenFile:1;
// Auto: check leading dot.
Owner

Comments need update too

Comments need update too
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
void KFileItem::setHidden( TDEIO::HiddenFileMatcher *matcher )
{
if ( !m_url.isEmpty() )
Owner

Before this code, we should abide to the m_hidden choice provided by:

  if ( m_hidden != Auto )
      return m_hidden == Hidden;
Before this code, we should abide to the m_hidden choice provided by: ``` if ( m_hidden != Auto ) return m_hidden == Hidden; ```
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
* True if file is "hidden" (i.e. hide-able)
by current HiddenFileMatcher standards
*/
bool m_bHiddenFile:1;
Owner

How about renaming this to m_bHiddenByMatcher? It's more specific. There is already a m_hidden property which can be Auto, Hidden, Shown. In case of Auto, he matcher will define whether the file is shown or not, hence the new suggested name.

How about renaming this to `m_bHiddenByMatcher`? It's more specific. There is already a m_hidden property which can be `Auto, Hidden, Shown`. In case of `Auto`, he matcher will define whether the file is shown or not, hence the new suggested name.
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
m_bLink( false ),
m_bIsLocalURL( _url.isLocalFile() ),
m_bMimeTypeKnown( false ),
m_bHiddenFile( false ),
Owner

In the construct body we should call isHidden(nullptr)' to make sure m_bHiddenFilestores the correct value based on the global matcher. Otherwise if we cannisHidden()(without matcher) somewhere else before ever callingisHidden(matcher)`, we risk getting the wrong result (false instead of the actual hiding status).

In the construct body we should call `isHidden(nullptr)' to make sure `m_bHiddenFile` stores the correct value based on the global matcher. Otherwise if we cann `isHidden()` (without matcher) somewhere else before ever calling `isHidden(matcher)`, we risk getting the wrong result (false instead of the actual hiding status).
Owner

Just noticed there is a call to init() in all constructors. We can do this inside the init() function, so it covers all constructors in one shot.

Just noticed there is a call to `init()` in all constructors. We can do this inside the `init()` function, so it covers all constructors in one shot.
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
m_bLink( false ),
m_bIsLocalURL( _url.isLocalFile() ),
m_bMimeTypeKnown( false ),
m_bHiddenFile( false ),
Owner

Same as above

Same as above
VinceR marked this conversation as resolved
MicheleC reviewed 2 years ago
m_bLink( false ),
m_bIsLocalURL( url.isLocalFile() ),
m_bMimeTypeKnown( !mimeType.isEmpty() ),
m_bHiddenFile( false ),
Owner

Same as above

Same as above
VinceR marked this conversation as resolved
Owner

@VinceR After adjusting the points we discussed so far, would you mind (force-)pushing the updated code before I continue the review? We have already many changes and it is better to realign on the code

@VinceR After adjusting the points we discussed so far, would you mind (force-)pushing the updated code before I continue the review? We have already many changes and it is better to realign on the code
VinceR commented 2 years ago
Poster
Collaborator

@VinceR After adjusting the points we discussed so far, would you mind (force-)pushing the updated code before I continue the review? We have already many changes and it is better to realign on the code

MicheleC, I am almost done with changes and limited testing. Implementation of a single global hidden file matcher in addition to application-specific instances turned out to be trickier than I predicted so I need a bit more time with "real" system testing.

Give me a couple of days, then I will push updated code and we can proceed from there.

> @VinceR After adjusting the points we discussed so far, would you mind (force-)pushing the updated code before I continue the review? We have already many changes and it is better to realign on the code MicheleC, I am almost done with changes and limited testing. Implementation of a single global hidden file matcher in addition to application-specific instances turned out to be trickier than I predicted so I need a bit more time with "real" system testing. Give me a couple of days, then I will push updated code and we can proceed from there.
Owner

MicheleC, I am almost done with changes and limited testing. Implementation of a single global hidden file matcher in addition to application-specific instances turned out to be trickier than I predicted so I need a bit more time with "real" system testing.

Sure, no worries @VinceR. Take the time that is needed.
I would even suggest we break down this in multiple parts, if it is easier. something like this:

  1. add global matcher and replicate current behavior for .dotfiles
  2. add TCC module or GUI to be able to change the global matcher
  3. add application specific matcher + GUI
    We can then test and merge one part at a time.
> MicheleC, I am almost done with changes and limited testing. Implementation of a single global hidden file matcher in addition to application-specific instances turned out to be trickier than I predicted so I need a bit more time with "real" system testing. Sure, no worries @VinceR. Take the time that is needed. I would even suggest we break down this in multiple parts, if it is easier. something like this: 1. add global matcher and replicate current behavior for .dotfiles 2. add TCC module or GUI to be able to change the global matcher 3. add application specific matcher + GUI We can then test and merge one part at a time.
VinceR added 1 commit 2 years ago
a39f9134cd
Implemented a single global "default" HiddenFileMatcher object that
VinceR commented 2 years ago
Poster
Collaborator

@MicheleC,

This took somewhat longer than I expected but I finally have some updates for us to discuss. I think I hit just about every point you brought up. The new code is actively used/tested on my main system. I believe everything is working correctly, especially in conjunction with tdebase commit 8481f9c3f4.

That said, I am not quite satisfied with how things are implemented in KDirLister and KFileItem. After you have completed your next round of reviews of the current code, I want to discuss with you an idea wherein KFileItem maintains and uses its own HiddenFileMatcher* variable, initialized to the GlobalHiddenFileMatcher->getInstance(), and updated (once) by KDirlister to point to its own HiddenFileMatcher*. Doing this might eliminate the need for 2 variants of isHidden().

@MicheleC, This took somewhat longer than I expected but I finally have some updates for us to discuss. I think I hit just about every point you brought up. The new code is actively used/tested on my main system. I believe everything is working correctly, especially in conjunction with tdebase commit https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/commit/8481f9c3f4eeceacf6b7ee9d8c76f54768b9c667. That said, I am not quite satisfied with how things are implemented in `KDirLister` and `KFileItem`. After you have completed your next round of reviews of the current code, I want to discuss with you an idea wherein `KFileItem` maintains and uses its own `HiddenFileMatcher*` variable, initialized to the `GlobalHiddenFileMatcher->getInstance()`, and updated (once) by `KDirlister` to point to its own `HiddenFileMatcher*`. Doing this might eliminate the need for 2 variants of `isHidden()`.
Owner

Thanks for the update @VinceR. I have to apologize in advance because most likely I will only be able to have a detail look at this next weekend, another busy work week ahead and some pending things to finish first :-(

Thanks for the update @VinceR. I have to apologize in advance because most likely I will only be able to have a detail look at this next weekend, another busy work week ahead and some pending things to finish first :-(
Owner

@VinceR I am finally back to this PR. Will start reviewing from tomorrow. Sorry for the delay :-)

@VinceR I am finally back to this PR. Will start reviewing from tomorrow. Sorry for the delay :-)
Owner

Hi @VinceR,

I want to discuss with you an idea wherein KFileItem maintains and uses its own HiddenFileMatcher* variable, initialized to the GlobalHiddenFileMatcher->getInstance(), and updated (once) by KDirlister to point to its own HiddenFileMatcher*. Doing this might eliminate the need for 2 variants of isHidden().

after reviewing the current code, I think your idea is good. KFileItems are created and used in many places, which makes dealing with them quite tricky. Your idea should help keep this simple, as long as we implement it carefully.
Moving forward, we should have something like this in place:

  1. KFileItem to have an internal HiddenFileMatcher pointer.
  2. Existing constructors of KFileItem to initialize such pointer to the global matcher object. This will allow the current TDE code to remain operational without disruption. Please keep the constructor syntax unchanged, for API/ABI compatibility.
  3. the function isHidden() will use the current matcher to determine if an item is hidden or not. There is no more any need to have two different isHidden methods.
  4. Add a new method to KFileItem API to allow to set a different matcher when necessary. This is not used yet, it will in future.

Following the model used for TDELocale, I suggest we proceed as follow for the global matcher:

  1. make standalone h/cpp files for the HiddenFileMatcher class.
  2. TDEGlobal to contain a pointer to the global instance of the matcher and will initialize it on the first usage (again, refer to TDELocale for an example)
  3. the CommonHiddenFileMatcher class is unnecessary. TDEGlobal will do exactly the same thing and is already available to all applications in TDE.

Once all the above is in place, we can move to KDirLister and other places that use KFileItems and the matchers, including the GUI to set/modify the matcher in use. You may want to consider implementing the steps above as a new PR, to keep the code cleaner.

This PR is quite big, so let's address it and merge it step by step. Trying to do all in one go is a massive job and it helps to break it down in smaller chunks and verify that all is still working along the way.

Hi @VinceR, > I want to discuss with you an idea wherein KFileItem maintains and uses its own HiddenFileMatcher* variable, initialized to the GlobalHiddenFileMatcher->getInstance(), and updated (once) by KDirlister to point to its own HiddenFileMatcher*. Doing this might eliminate the need for 2 variants of isHidden(). after reviewing the current code, I think your idea is good. KFileItems are created and used in many places, which makes dealing with them quite tricky. Your idea should help keep this simple, as long as we implement it carefully. Moving forward, we should have something like this in place: 1. KFileItem to have an internal HiddenFileMatcher pointer. 2. Existing constructors of KFileItem to initialize such pointer to the global matcher object. This will allow the current TDE code to remain operational without disruption. Please keep the constructor syntax unchanged, for API/ABI compatibility. 3. the function `isHidden()` will use the current matcher to determine if an item is hidden or not. There is no more any need to have two different `isHidden` methods. 4. Add a new method to KFileItem API to allow to set a different matcher when necessary. This is not used yet, it will in future. Following the model used for TDELocale, I suggest we proceed as follow for the global matcher: 1. make standalone h/cpp files for the HiddenFileMatcher class. 2. TDEGlobal to contain a pointer to the global instance of the matcher and will initialize it on the first usage (again, refer to TDELocale for an example) 3. the CommonHiddenFileMatcher class is unnecessary. TDEGlobal will do exactly the same thing and is already available to all applications in TDE. Once all the above is in place, we can move to KDirLister and other places that use KFileItems and the matchers, including the GUI to set/modify the matcher in use. You may want to consider implementing the steps above as a new PR, to keep the code cleaner. This PR is quite big, so let's address it and merge it step by step. Trying to do all in one go is a massive job and it helps to break it down in smaller chunks and verify that all is still working along the way.
VinceR commented 2 years ago
Poster
Collaborator

@MicheleC,

I am glad you were recently delayed in getting back to reviewing this PR because I also have been too busy to do any more work on it!. Your comments reflect what I have been thinking would be the next step. Here are some of my selective responses to them:

  1. Add a new method to KFileItem API to allow to set a different matcher when necessary. This is not used yet, it will in future.

Actually we would use it right away to enable functionality for Konqueror listview (via associated KDirLister). But if you want to break up the PR, I guess we could save that part for later.

  1. the CommonHiddenFileMatcher class is unnecessary. TDEGlobal will do exactly the same thing and is already available to all applications in TDE.

I don't quite follow this, but I still need to look at the TDELocale methodology. As long as there is a single pre-initialized instance of a "global" HiddenFileMatcher that other code can reference, it will all work just fine.

This PR is quite big, so let's address it and merge it step by step

That is probably a wise course of action. I guess I need to make another branch (just for myself for the while) that splits off the additional stuff I am doing in KDirLister.

This will take a bit longer while I do the necessary research, coding, and testing.

Many thanks for working with me on this,

Vince

@MicheleC, I am glad you were recently delayed in getting back to reviewing this PR because I also have been too busy to do any more work on it!. Your comments reflect what I have been thinking would be the next step. Here are some of my selective responses to them: > 4. Add a new method to KFileItem API to allow to set a different matcher when necessary. This is not used yet, it will in future. Actually we would use it right away to enable functionality for Konqueror listview (via associated KDirLister). But if you want to break up the PR, I guess we could save that part for later. > 3. the CommonHiddenFileMatcher class is unnecessary. TDEGlobal will do exactly the same thing and is already available to all applications in TDE. I don't quite follow this, but I still need to look at the TDELocale methodology. As long as there is a single pre-initialized instance of a "global" HiddenFileMatcher that other code can reference, it will all work just fine. >This PR is quite big, so let's address it and merge it step by step That is probably a wise course of action. I guess I need to make another branch (just for myself for the while) that splits off the additional stuff I am doing in KDirLister. This will take a bit longer while I do the necessary research, coding, and testing. Many thanks for working with me on this, Vince
Owner
  1. the CommonHiddenFileMatcher class is unnecessary. TDEGlobal will do exactly the same thing and is already available to all applications in TDE.

I don't quite follow this, but I still need to look at the TDELocale methodology. As long as there is a single pre-initialized instance of a "global" HiddenFileMatcher that other code can reference, it will all work just fine.

Basically TDEGlobal will instantiate and provide access to a global HiddenFileMatcher. By default, this should provide the current behavior, that is filter out files that start with a dot. I haven't really commented about the HiddenFileMatcher class yet, although at a first glance I will some feedback to provide. Let me know if you prefer to have that now or after you create the new PR.

This PR is quite big, so let's address it and merge it step by step

That is probably a wise course of action. I guess I need to make another branch (just for myself for the while) that splits off the additional stuff I am doing in KDirLister.

Yes, probably wiser to use a different branch. We can keep this PR for reference, so the rest of the code is available while in the meantime we work through another branch step by step

Many thanks for working with me on this,

No worries, happy to work together and share knowledge. Any little bit helps to make TDE a better DE!!

> > 3. the CommonHiddenFileMatcher class is unnecessary. TDEGlobal will do exactly the same thing and is already available to all applications in TDE. > > I don't quite follow this, but I still need to look at the TDELocale methodology. As long as there is a single pre-initialized instance of a "global" HiddenFileMatcher that other code can reference, it will all work just fine. Basically TDEGlobal will instantiate and provide access to a global HiddenFileMatcher. By default, this should provide the current behavior, that is filter out files that start with a dot. I haven't really commented about the HiddenFileMatcher class yet, although at a first glance I will some feedback to provide. Let me know if you prefer to have that now or after you create the new PR. > >This PR is quite big, so let's address it and merge it step by step > > That is probably a wise course of action. I guess I need to make another branch (just for myself for the while) that splits off the additional stuff I am doing in KDirLister. Yes, probably wiser to use a different branch. We can keep this PR for reference, so the rest of the code is available while in the meantime we work through another branch step by step > Many thanks for working with me on this, No worries, happy to work together and share knowledge. Any little bit helps to make TDE a better DE!!
VinceR commented 2 years ago
Poster
Collaborator

@MicheleC,

I will be starting a new PR to simplify the code review and implementation process. The changes in that PR will be introduced incrementally as follows:

  1. Implement 2 new classes in tdecore: a general purpose TDEStringMatcher and a TDEHiddenFileMatcher that inherits from it. Implement the first "user" of TDEHiddenFileMatcher as a single instance TDEGlobal::hiddenFileMatcher()
  2. Modify KFileItem to use its own TDEHiddenFileMatcher* in isHidden(), initialized to the global instance and replaceable via an externally callable method. I am hoping to also retain and improve current match caching.
  3. Modify KDirLister to use its own TDEHiddenFileMatcher* which it can pass on to each KFileItem as it gets created.

Since what I have in the current PR already works just fine, I feel compelled to retrofit any changes in the new PR back to this one for complete testing before I submit them for your review. That will cause some delay but I would feel better that you are reviewing code that actually works :)

I am ALMOST done with (1) and just need to do some testing. I am hoping to have the new PR ready for you by Wednesday.

@MicheleC, I will be starting a new PR to simplify the code review and implementation process. The changes in that PR will be introduced incrementally as follows: 1. Implement 2 new classes in tdecore: a general purpose `TDEStringMatcher` and a `TDEHiddenFileMatcher` that inherits from it. Implement the first "user" of `TDEHiddenFileMatcher` as a single instance `TDEGlobal::hiddenFileMatcher()` 2. Modify `KFileItem` to use its own `TDEHiddenFileMatcher*` in `isHidden()`, initialized to the global instance and replaceable via an externally callable method. I am hoping to also retain and improve current match caching. 3. Modify `KDirLister` to use its own `TDEHiddenFileMatcher*` which it can pass on to each `KFileItem` as it gets created. Since what I have in the current PR already works just fine, I feel compelled to retrofit any changes in the new PR back to this one for complete testing before I submit them for your review. That will cause some delay but I would feel better that you are reviewing code that actually works :) I am ALMOST done with (1) and just need to do some testing. I am hoping to have the new PR ready for you by Wednesday.
Owner

@VinceR,
sounds like a good plan forward 👍 If I may suggest, it may be better to do 1. and 2. first, then test, merge and make sure all apps work as expected after a rebuild (they should) and then we move to 3.
Not sure why we need a TDEStringMatcher-TDEHiddenFileMatcher hierarchy, but will wait to see the code before further comments. If such structure is useful, we shall go for it.

I am hoping to have the new PR ready for you by Wednesday.

Take your time. It's another busy week at work, so most likely I won't review before the weekend anyway :-)

@VinceR, sounds like a good plan forward :+1: If I may suggest, it may be better to do 1. and 2. first, then test, merge and make sure all apps work as expected after a rebuild (they should) and then we move to 3. Not sure why we need a `TDEStringMatcher`-`TDEHiddenFileMatcher` hierarchy, but will wait to see the code before further comments. If such structure is useful, we shall go for it. > I am hoping to have the new PR ready for you by Wednesday. Take your time. It's another busy week at work, so most likely I won't review before the weekend anyway :-)
VinceR commented 2 years ago
Poster
Collaborator

@VinceR,
sounds like a good plan forward 👍 If I may suggest, it may be better to do 1. and 2. first, then test, merge and make sure all apps work as expected after a rebuild (they should) and then we move to 3.

Since I am leaving on a weeklong vacation tomorrow, I won't have enough time to fully implement and test (2). In order to give you something to look at, I wanted to submit (1) since that is ready (and tested, albeit with all the other baggage in this PR).

If you want to postpone review until I get to (2), that's OK -- ETA will be 13 September. I suppose I also ought to add a proper control module as well.

Not sure why we need a TDEStringMatcher-TDEHiddenFileMatcher hierarchy, but will wait to see the code before further comments. If such structure is useful, we shall go for it.

Since TDEHiddenFileMatcher class provides a special purpose iterative string matching function, I thought it might be nice to also provide a more general class that applications can use for other purposes

I am hoping to have the new PR ready for you by Wednesday.

Take your time. It's another busy week at work, so most likely I won't review before the weekend anyway :-)

So instead of reviewing another PR, you can just relax :)

> @VinceR, > sounds like a good plan forward :+1: If I may suggest, it may be better to do 1. and 2. first, then test, merge and make sure all apps work as expected after a rebuild (they should) and then we move to 3. Since I am leaving on a weeklong vacation tomorrow, I won't have enough time to fully implement and test (2). In order to give you something to look at, I wanted to submit (1) since that is ready (and tested, albeit with all the other baggage in this PR). If you want to postpone review until I get to (2), that's OK -- ETA will be 13 September. I suppose I also ought to add a proper control module as well. > Not sure why we need a `TDEStringMatcher`-`TDEHiddenFileMatcher` hierarchy, but will wait to see the code before further comments. If such structure is useful, we shall go for it. Since TDEHiddenFileMatcher class provides a special purpose iterative string matching function, I thought it might be nice to also provide a more general class that applications can use for other purposes > > I am hoping to have the new PR ready for you by Wednesday. > > Take your time. It's another busy week at work, so most likely I won't review before the weekend anyway :-) So instead of reviewing another PR, you can just relax :)
Owner

Hi @VinceR,
hope you are enjoying your holiday :-)

I am ok to review either (1) only or (1) and (2) together. In fact I thought you had pushed a PR with (1) only and wanted to review it today, but I can't seem to find it. I guess I may have misunderstood your prev comment.

Once you are back and ready, let me know and we resume the discussion.

Hi @VinceR, hope you are enjoying your holiday :-) I am ok to review either (1) only or (1) and (2) together. In fact I thought you had pushed a PR with (1) only and wanted to review it today, but I can't seem to find it. I guess I may have misunderstood your prev comment. Once you are back and ready, let me know and we resume the discussion.
VinceR commented 2 years ago
Poster
Collaborator

Hi @MicheleC,

I am back and just created a new PR #178. I am hoping it will be easier to navigate than this one which ended up with a lot of RnD. Hopefully the commit messages and my introductory comments in the new PR will help you proceed with your review more easily.

VinceR

Hi @MicheleC, I am back and just created a new PR https://mirror.git.trinitydesktop.org/gitea/TDE/tdelibs/pulls/178. I am hoping it will be easier to navigate than this one which ended up with a lot of RnD. Hopefully the commit messages and my introductory comments in the new PR will help you proceed with your review more easily. VinceR
Owner

Hi Vince, will have a look thorugh the weekend, or earlier if find the time.

Hi Vince, will have a look thorugh the weekend, or earlier if find the time.
Owner

@VinceR
I started the review and there are lot of comments. I have published what done so far to make sure Firefox does not play tricks and lose all the comments made till now. I will continue the review tomorrow and if needed Monday, so please hold on till I complete it and I further ping you on this PR.

I hope the big amount of comments is not discouraging you, on the contrary that it serves as guidance for refining the solution.

@VinceR I started the review and there are lot of comments. I have published what done so far to make sure Firefox does not play tricks and lose all the comments made till now. I will continue the review tomorrow and if needed Monday, so please hold on till I complete it and I further ping you on this PR. I hope the big amount of comments is not discouraging you, on the contrary that it serves as guidance for refining the solution.
Owner

@VinceR
to avoid keeping too many PR open and create confusion, is it ok if we mark this one as closed?
Also since the code has changed quite a bit with review on PR #178, would it be ok to delete the branch associated with this PR? This is mostly to keep the tdelibs repo as clean as possible. If you think the code in this PR is still required, we can leave the branch around for longer, no problem.

@VinceR to avoid keeping too many PR open and create confusion, is it ok if we mark this one as closed? Also since the code has changed quite a bit with review on PR #178, would it be ok to delete the branch associated with this PR? This is mostly to keep the tdelibs repo as clean as possible. If you think the code in this PR is still required, we can leave the branch around for longer, no problem.
VinceR commented 2 years ago
Poster
Collaborator

to avoid keeping too many PR open and create confusion, is it ok if we mark this one as closed?

Yes, go ahead and close the PR and remove the branch. I assume I will still be able to get back to the comments in this PR.

While branch issue/270/tdelibs is still the one I do active development & testing, I will not be doing any more pushes from it. Instead, I will selectively port changes to branch issue/270/tdelibs-V2 for your review.

Please keep related tdebase PR#273 open for the time being.

> to avoid keeping too many PR open and create confusion, is it ok if we mark this one as closed? Yes, go ahead and close the PR and remove the branch. I assume I will still be able to get back to the comments in this PR. While branch `issue/270/tdelibs` is still the one I do active development & testing, I will not be doing any more pushes from it. Instead, I will selectively port changes to branch `issue/270/tdelibs-V2` for your review. Please keep related [tdebase PR#273](https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/pulls/273) open for the time being.
VinceR commented 2 years ago
Poster
Collaborator

I assume I will still be able to get back to the comments in this PR.

Actually, this won't be an issue. I archived the web page & associated resources locally.

>I assume I will still be able to get back to the comments in this PR. Actually, this won't be an issue. I archived the web page & associated resources locally.
MicheleC closed this pull request 2 years ago
MicheleC deleted branch issue/270/tdelibs 2 years ago
Owner

The comments and code remain available through gitea, so you can always come back here if you need to review things. In fact, the commits remain available in git too, if you checkout by hash. The only things that disappear is the branch pointer in git, which helps in keeping the repo cleaner.

The comments and code remain available through gitea, so you can always come back here if you need to review things. In fact, the commits remain available in git too, if you checkout by hash. The only things that disappear is the branch pointer in git, which helps in keeping the repo cleaner.
This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/tdelibs#163
Loading…
There is no content yet.