-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the issue of incorrect requests to update a panel (#433)
* Fixed the issue of incorrect requests to update a panel - Added more checks to discard stopped and stale refresh requests. - Limited the length of the reload queue to two jobs. - Added more logging points. - Fixed #357 * Removed a duplicate field * clang-tidy
- Loading branch information
1 parent
33c661d
commit bfc0510
Showing
6 changed files
with
131 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,52 @@ | ||
// Copyright (C) 2017-2021 Michael Kazakov. Subject to GNU General Public License version 3. | ||
// Copyright (C) 2017-2024 Michael Kazakov. Subject to GNU General Public License version 3. | ||
#pragma once | ||
|
||
#include <VFS/VFS.h> | ||
#include <Base/CFPtr.h> | ||
#include <fmt/format.h> | ||
|
||
namespace nc::panel::data { | ||
|
||
struct ItemVolatileData; | ||
|
||
struct ExternalEntryKey { | ||
ExternalEntryKey(); | ||
ExternalEntryKey() noexcept; | ||
ExternalEntryKey(const VFSListingItem &_item, const ItemVolatileData &_item_vd); | ||
|
||
std::string name; | ||
std::string extension; | ||
nc::base::CFPtr<CFStringRef> display_name; | ||
uint64_t size; | ||
time_t mtime; | ||
time_t btime; | ||
time_t atime; | ||
uint64_t size = 0; | ||
time_t mtime = 0; | ||
time_t btime = 0; | ||
time_t atime = 0; | ||
time_t add_time; // -1 means absent | ||
bool is_dir; | ||
bool is_dir = false; | ||
bool is_valid() const noexcept; | ||
}; | ||
|
||
} // namespace nc::panel::data | ||
|
||
template <> | ||
struct fmt::formatter<nc::panel::data::ExternalEntryKey> : fmt::formatter<std::string> { | ||
constexpr auto parse(fmt::format_parse_context &ctx) { return ctx.begin(); } | ||
|
||
template <typename FormatContext> | ||
auto format(const nc::panel::data::ExternalEntryKey &_key, FormatContext &_ctx) | ||
{ | ||
|
||
return fmt::format_to(_ctx.out(), | ||
"(name='{}', extension='{}', display='{}', size={}, directory={}, mtime={}, btime={}, " | ||
"atime={}, addtime={})", | ||
_key.name, | ||
_key.extension, | ||
_key.display_name ? nc::base::CFStringGetUTF8StdString(_key.display_name.get()) | ||
: std::string{}, | ||
_key.size, | ||
_key.is_dir, | ||
_key.mtime, | ||
_key.btime, | ||
_key.atime, | ||
_key.add_time); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters