summaryrefslogtreecommitdiff
path: root/UnityCore
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2012-03-20 11:13:38 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2012-03-20 11:13:38 +0100
commit7b924ff9b85308323e37a85623b5f038af598231 (patch)
tree80c363f06998f8106ab9cd41119187b97659f521 /UnityCore
parent644a624f36dd667ab9d63a8986e374d9fe3d67e9 (diff)
parent941528e1aa405626d946854b320aec7a44136f14 (diff)
Merging with lp:~3v1n0/unity/indicators-p (and trunk)
(bzr r1858.12.12)
Diffstat (limited to 'UnityCore')
-rw-r--r--UnityCore/FilesystemLenses.cpp8
-rw-r--r--UnityCore/HomeLens.cpp4
-rw-r--r--UnityCore/Lens.cpp4
3 files changed, 10 insertions, 6 deletions
diff --git a/UnityCore/FilesystemLenses.cpp b/UnityCore/FilesystemLenses.cpp
index 42a6d53bd..13073a527 100644
--- a/UnityCore/FilesystemLenses.cpp
+++ b/UnityCore/FilesystemLenses.cpp
@@ -236,7 +236,7 @@ void LensDirectoryReader::Impl::LoadFileContentCallback(GObject* source,
gboolean result = g_file_load_contents_finish(file, res,
&contents, &length,
NULL, error.AsOutParam());
- if (result && !error)
+ if (result)
{
self->GetLensDataFromKeyFile(file, contents.Value(), length);
self->SortLensList();
@@ -246,6 +246,8 @@ void LensDirectoryReader::Impl::LoadFileContentCallback(GObject* source,
LOG_WARN(logger) << "Unable to read lens file "
<< path.Str() << ": "
<< error;
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return; // self is invalid now
}
self->cancel_map_.erase(file);
@@ -350,6 +352,7 @@ public:
~Impl()
{
if (timeout_id != 0) g_source_remove (timeout_id);
+ finished_slot_.disconnect();
}
void OnLoadingFinished();
@@ -363,6 +366,7 @@ public:
FilesystemLenses* owner_;
LensDirectoryReader::Ptr reader_;
LensList lenses_;
+ sigc::connection finished_slot_;
guint timeout_id;
};
@@ -371,7 +375,7 @@ FilesystemLenses::Impl::Impl(FilesystemLenses* owner, LensDirectoryReader::Ptr c
, reader_(reader)
, timeout_id(0)
{
- reader_->load_finished.connect(sigc::mem_fun(this, &Impl::OnLoadingFinished));
+ finished_slot_ = reader_->load_finished.connect(sigc::mem_fun(this, &Impl::OnLoadingFinished));
if (reader_->IsDataLoaded())
{
// we won't get any signal, so let's just emit our signals after construction
diff --git a/UnityCore/HomeLens.cpp b/UnityCore/HomeLens.cpp
index b14f29b33..5a1239132 100644
--- a/UnityCore/HomeLens.cpp
+++ b/UnityCore/HomeLens.cpp
@@ -770,7 +770,7 @@ void HomeLens::Impl::OnLensAdded (Lens::Ptr& lens)
if (running_searches_ <= 0)
{
owner_->search_finished.emit(Hints());
- LOG_DEBUG(logger) << "Search finished";
+ LOG_INFO(logger) << "Search finished";
}
});
@@ -911,7 +911,7 @@ void HomeLens::Search(std::string const& search_string)
{
if (lens->search_in_global())
{
- LOG_DEBUG(logger) << " - Global search on '" << lens->id() << "' for '"
+ LOG_INFO(logger) << " - Global search on '" << lens->id() << "' for '"
<< search_string << "'";
lens->view_type = ViewType::HOME_VIEW;
lens->GlobalSearch(search_string);
diff --git a/UnityCore/Lens.cpp b/UnityCore/Lens.cpp
index b55f16ab4..ceb5f156a 100644
--- a/UnityCore/Lens.cpp
+++ b/UnityCore/Lens.cpp
@@ -456,9 +456,9 @@ void Lens::Impl::Search(std::string const& search_string)
{
LOG_DEBUG(logger) << "Searching '" << id_ << "' for '" << search_string << "'";
- if (!proxy_->IsConnected())
+ if (proxy_ == NULL)
{
- LOG_DEBUG(logger) << "Skipping search. Proxy not connected. ('" << id_ << "')";
+ LOG_DEBUG(logger) << "Skipping search. Proxy not initialized. ('" << id_ << "')";
return;
}