Internal cleanup filebrowser threading; see issue #599
This commit is contained in:
@@ -54,6 +54,10 @@ ThumbBrowserBase::ThumbBrowserBase ()
|
||||
}
|
||||
|
||||
void ThumbBrowserBase::scrollChanged () {
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(entryMutex);
|
||||
#endif
|
||||
|
||||
for (int i=0; i<fd.size(); i++)
|
||||
fd[i]->setOffset ((int)(hscroll.get_value()), (int)(vscroll.get_value()));
|
||||
@@ -133,6 +137,10 @@ void ThumbBrowserBase::configScrollBars () {
|
||||
}
|
||||
|
||||
void ThumbBrowserBase::arrangeFiles () {
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(entryMutex);
|
||||
#endif
|
||||
|
||||
int N = fd.size ();
|
||||
// apply filter
|
||||
@@ -249,6 +257,10 @@ void ThumbBrowserBase::Internal::on_realize()
|
||||
}
|
||||
|
||||
bool ThumbBrowserBase::Internal::on_query_tooltip (int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) {
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(parent->entryMutex);
|
||||
#endif
|
||||
|
||||
Glib::ustring ttip = "";
|
||||
for (int i=0; i<parent->fd.size(); i++)
|
||||
@@ -307,6 +319,12 @@ bool ThumbBrowserBase::Internal::on_button_press_event (GdkEventButton* event) {
|
||||
void ThumbBrowserBase::buttonPressed (int x, int y, int button, GdkEventType type, int state, int clx, int cly, int clw, int clh) {
|
||||
ThumbBrowserEntryBase* fileDescr = NULL;
|
||||
bool handled = false;
|
||||
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(entryMutex);
|
||||
#endif
|
||||
|
||||
for (int i=0; i<fd.size(); i++)
|
||||
if (fd[i]->drawable) {
|
||||
if (fd[i]->inside (x, y) && fd[i]->insideWindow (clx, cly, clw, clh))
|
||||
@@ -409,6 +427,11 @@ bool ThumbBrowserBase::Internal::on_expose_event(GdkEventExpose* event) {
|
||||
|
||||
Glib::RefPtr<Gdk::Window> window = get_window();
|
||||
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(parent->entryMutex);
|
||||
#endif
|
||||
|
||||
int w = get_width();
|
||||
int h = get_height();
|
||||
|
||||
@@ -430,6 +453,11 @@ bool ThumbBrowserBase::Internal::on_expose_event(GdkEventExpose* event) {
|
||||
|
||||
bool ThumbBrowserBase::Internal::on_button_release_event (GdkEventButton* event) {
|
||||
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(parent->entryMutex);
|
||||
#endif
|
||||
|
||||
int w = get_width();
|
||||
int h = get_height();
|
||||
|
||||
@@ -440,6 +468,10 @@ bool ThumbBrowserBase::Internal::on_button_release_event (GdkEventButton* event)
|
||||
}
|
||||
|
||||
bool ThumbBrowserBase::Internal::on_motion_notify_event (GdkEventMotion* event) {
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(parent->entryMutex);
|
||||
#endif
|
||||
|
||||
int w = get_width();
|
||||
int h = get_height();
|
||||
@@ -483,8 +515,15 @@ void ThumbBrowserBase::zoomChanged (bool zoomIn) {
|
||||
previewHeight = newHeight;
|
||||
if (inTabMode) options.thumbSizeTab = newHeight; else options.thumbSize = newHeight;
|
||||
|
||||
for (int i=0; i<fd.size(); i++)
|
||||
fd[i]->resize (previewHeight);
|
||||
{
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(entryMutex);
|
||||
#endif
|
||||
|
||||
for (int i=0; i<fd.size(); i++) fd[i]->resize (previewHeight);
|
||||
}
|
||||
|
||||
redraw ();
|
||||
#ifdef _WIN32
|
||||
gdk_window_process_updates (get_window()->gobj(), true);
|
||||
@@ -494,6 +533,11 @@ void ThumbBrowserBase::zoomChanged (bool zoomIn) {
|
||||
int ThumbBrowserBase::getCurrentThumbSize() { return inTabMode ? options.thumbSizeTab : options.thumbSize; }
|
||||
|
||||
void ThumbBrowserBase::refreshThumbImages () {
|
||||
{
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(entryMutex);
|
||||
#endif
|
||||
|
||||
for (int i=0; i<fd.size(); i++){
|
||||
previewHeight = getCurrentThumbSize();
|
||||
@@ -501,11 +545,17 @@ void ThumbBrowserBase::refreshThumbImages () {
|
||||
/* called if necessary by resize()
|
||||
fd[i]->refreshThumbnailImage (); TODO: This might cause crashes on some installations */
|
||||
}
|
||||
}
|
||||
|
||||
redraw ();
|
||||
}
|
||||
|
||||
void ThumbBrowserBase::refreshQuickThumbImages () {
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(entryMutex);
|
||||
#endif
|
||||
|
||||
for (int i=0; i<fd.size(); ++i){
|
||||
fd[i]->refreshQuickThumbnailImage ();
|
||||
}
|
||||
@@ -514,8 +564,16 @@ void ThumbBrowserBase::refreshQuickThumbImages () {
|
||||
void ThumbBrowserBase::refreshEditedState (const std::set<Glib::ustring>& efiles) {
|
||||
|
||||
editedFiles = efiles;
|
||||
{
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(entryMutex);
|
||||
#endif
|
||||
|
||||
for (int i=0; i<fd.size(); i++)
|
||||
fd[i]->framed = editedFiles.find (fd[i]->filename)!=editedFiles.end();
|
||||
}
|
||||
|
||||
queue_draw ();
|
||||
}
|
||||
|
||||
@@ -530,6 +588,11 @@ void ThumbBrowserBase::enableTabMode(bool enable) {
|
||||
arrangement = inTabMode ? ThumbBrowserBase::TB_Horizontal : ThumbBrowserBase::TB_Vertical;
|
||||
|
||||
if (options.thumbSizeTab!=options.thumbSize) {
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(entryMutex);
|
||||
#endif
|
||||
|
||||
for (int i=0; i<fd.size(); i++)
|
||||
fd[i]->resize (getCurrentThumbSize());
|
||||
}
|
||||
@@ -568,7 +631,15 @@ void ThumbBrowserBase::setScrollPosition (double h, double v) {
|
||||
// needed for auto-height in single tab
|
||||
int ThumbBrowserBase::getEffectiveHeight() {
|
||||
int h=0;
|
||||
{
|
||||
// TODO: Check for Linux
|
||||
#ifdef WIN32
|
||||
Glib::Mutex::Lock lock(entryMutex);
|
||||
#endif
|
||||
|
||||
if (fd.size()>0) h=fd[0]->getEffectiveHeight();
|
||||
}
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user