Skip to content

Commit

Permalink
Let icewmbg log the image path when verbose is true.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Feb 20, 2024
1 parent 947780f commit 8c1398f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/icewmbg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ typedef ref<YImage> Image;

class Cache {
public:
Cache() { }
Cache(bool verb) : verbose(verb) { }
~Cache() { clear(); }
void clear() { iname = null; image = null; }
Image get(const mstring& name) {
Image get(mstring name) {
if (iname != name) {
if (verbose) tlog("load %s", name.c_str());
iname = name;
image = YImage::load(iname);
if (image == null && testOnce(iname, __LINE__)) {
Expand All @@ -39,6 +40,7 @@ class Cache {
private:
mstring iname;
Image image;
bool verbose;
};

class Background: public YXApplication, private YTimerListener {
Expand Down Expand Up @@ -163,6 +165,7 @@ Background::Background(int *argc, char ***argv, bool verb):
randInited(false),
themeInited(false),
imageInited(false),
cache(verb),
mypid(getpid()),
activeWorkspace(0),
cycleOffset(0),
Expand Down

0 comments on commit 8c1398f

Please sign in to comment.