~sil2100/unity/ubuntu_6.8.0

« back to all changes in this revision

Viewing changes to UnityCore/DesktopUtilities.cpp

  • Committer: Łukasz 'sil2100' Zemczak
  • Date: 2012-10-04 16:47:13 UTC
  • mfrom: (55.813.27)
  • Revision ID: lukasz.zemczak@canonical.com-20121004164713-nlpdhe3vfi7hdbuw
* New upstream release.
  - unity 6.8 candidate segfaults on "app expose" with low gfx mode 
    (LP: #1060148)
  - [regression] Dash - Left separator is missing (LP: #1057798)
  - unity-panel-service crashed with SIGSEGV in 
    panel_indicator_entry_accessible_get_n_children() from 
    atk_object_get_n_accessible_children() (LP: #913324)
  - [regression] If unity is started with maximized dash, unmaximizing the 
    dash does not wrap rows (LP: #1053116)
  - Dash lens buttons don't work after changing form factor to maximize on 
    desktop (LP: #1053316)
  - Clicking on Workspace Switcher icon when the expo is showing, not always
    closes it 1059759 convert files list deprecated keys (LP: #1059594)
  - Unity through llvmpipe is slow (LP: #1046497)
  - compiz crashed with SIGSEGV in unity::QuicklistView::Show() from 
    unity::QuicklistManager::ShowQuicklist() (LP: #1055995)
  - compiz crashed with SIGSEGV from 
    unity::dash::HomeLens::Impl::LensSearchFinished() (LP: #1054219)
  - [regression] Starting an app & then locking to launcher is not persistent
    across sessions (LP: #1054645)
  - [regression] Dash, Launcher, Menu Bar - Unintended shadows are rendered 
    for the Unity Launcher and Panel, when the dash is open (LP: #1043260)
  - [Unity 6.x] Active blur doesn't update if you disable CCSM > OpenGL > 
    Framebuffer object (LP: #1039999)
  - Alt+Tab/Alt+grave brings other window to the front but loses focus 
    entirely. (LP: #1035628)
  - Spread - Scaling all the windows is too slow (LP: #1055643)
  - Window management - Middle clicking on a window inside the spread should
    close that window (equivalent action to clicking on the close button) 
    (LP: #1052821)
  - Scale window decorations don't have properly rounded corners 
    (LP: #1055610)
  - Scale window decorations text does not match theme style (Radiance) 
    (LP: #1055609)
  - Spread window decorations does not match the theme when changed 
    (LP: #1055605)
  - scaled window decorations are sometimes wider than the window 
    (LP: #1053225)
  - Launcher should not auto-hide after dragging an icon, if mouse is still
    over it (LP: #1053978)
  - unity spread window on second click not working when ibus language panel
    is shown. (LP: #1035895)
  - windows.push_back(<uninitialized value>) in 
    BamfLauncherIcon::GetFocusableWindows (LP: #1053220)
  - Category emblems are blurry (LP: #1056874)
  - Rendering flaws of the dash previews (LP: #1055455)
  - [UIFe] Social Lens doesn't have authorised and meaningful icon 
    (LP: #1056191)
  - [dash] Preview fade out animation hangs occasionally (LP: #1058145)
  - Dash - rendering of ribbons shouldn't be relative (LP: #1057971)
  - Horizontal alignment search box and views below (LP: #1055544)
  - Compiz crashed in cairo_save() from 
    unity::UnityWindow::RenderDecoration() from 
    unity::UnityWindow::scalePaintDecoration() from 
    ScaleWindow::scalePaintDecoration() (LP: #1061396)
  - [regression] Spinner doesn't spin around its center (LP: #1061081)
  - [regression] Graphical glitches in HUD/Dash bottom left and top right 
    corner (LP: #1060532)
  - [Quantal] unity-lens-application does not start on some slow machines 
    (LP: #1058619)
  - [Dash] Rendering flaw of the dash search entry (LP: #1059562)
  - [dash] Rendering flaw of filterbar after scrolling down/scrolling up. 
    (LP: #1059607)
  - Unity launcher doesn't prompt for password to unlock the device when 
    clicking on a encrypted volume icon (LP: #713432)
  - [regression] Unable to add desktop files with spaces in their name from 
    Nautilus into the Launcher (LP: #1055552 )
  - Missing context menus for Qt apps after minimizing the window 
    (LP: #929712)
  - Music preview note image is blurry (LP: #1060195)

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
  if (desktop_path.empty())
88
88
    return "";
89
89
 
 
90
  glib::String unescaped(g_uri_unescape_string(desktop_path.c_str(), NULL));
 
91
  std::string const& desktop_file = unescaped.Str();
 
92
 
 
93
  if (desktop_file.empty())
 
94
    return "";
 
95
 
90
96
  for (auto dir : default_paths)
91
97
  {
92
98
    if (!dir.empty())
100
106
        dir.append(G_DIR_SEPARATOR_S "applications" G_DIR_SEPARATOR_S);
101
107
      }
102
108
 
103
 
      if (desktop_path.find(dir) == 0)
 
109
      if (desktop_file.find(dir) == 0)
104
110
      {
105
111
        // if we are in a subdirectory of system path, the store name should
106
112
        // be subdir-filename.desktop
107
 
        std::string desktop_suffix = desktop_path.substr(dir.size());
 
113
        std::string desktop_suffix = desktop_file.substr(dir.size());
108
114
        std::replace(desktop_suffix.begin(), desktop_suffix.end(), G_DIR_SEPARATOR, '-');
109
115
 
110
116
        return desktop_suffix;
112
118
    }
113
119
  }
114
120
 
115
 
  return desktop_path;
 
121
  return desktop_file;
116
122
}
117
123
 
118
124
std::string DesktopUtilities::GetDesktopID(std::string const& desktop_path)
126
132
  if (desktop_id.empty())
127
133
    return "";
128
134
 
 
135
  glib::String unescaped_id(g_uri_unescape_string(desktop_id.c_str(), NULL));
 
136
  std::string const& id = unescaped_id.Str();
 
137
 
 
138
  if (id.empty())
 
139
    return "";
 
140
 
129
141
  glib::Object<GDesktopAppInfo> info;
130
142
 
131
 
  if (desktop_id.find(G_DIR_SEPARATOR_S) != std::string::npos)
132
 
    info = g_desktop_app_info_new_from_filename(desktop_id.c_str());
 
143
  if (id.find(G_DIR_SEPARATOR_S) != std::string::npos)
 
144
    info = g_desktop_app_info_new_from_filename(id.c_str());
133
145
  else
134
 
    info = g_desktop_app_info_new(desktop_id.c_str());
 
146
    info = g_desktop_app_info_new(id.c_str());
135
147
 
136
148
  if (info)
137
149
  {