File: initialization.cpp

package info (click to toggle)
aoflagger 3.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,000 kB
  • sloc: cpp: 67,891; python: 497; sh: 242; makefile: 22
file content (26 lines) | stat: -rw-r--r-- 917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "initialization.h"

#include <filesystem>
#include <memory>

#include <gtkmm/icontheme.h>

#include <version.h>

void SetupIconTheme(const std::string& argv0) {
  const std::shared_ptr<Gtk::IconTheme> iconTheme =
      Gtk::IconTheme::get_for_display(Gdk::Display::get_default());

  const std::filesystem::path argv0Root =
      std::filesystem::path(argv0).remove_filename();
  if (!std::filesystem::equivalent(
          argv0Root / "..", std::filesystem::path(AOFLAGGER_INSTALL_PATH))) {
    const std::filesystem::path iconPathC =
        std::filesystem::path(AOFLAGGER_INSTALL_PATH) / "share/icons";
    iconTheme->add_search_path(iconPathC.string());
  }
  const std::filesystem::path iconPathA = argv0Root / "../share/icons";
  iconTheme->add_search_path(iconPathA.string());
  const std::filesystem::path iconPathB = argv0Root / "../data/icons";
  iconTheme->add_search_path(iconPathB.string());
}