Bug 258504 - KDevelop crashes after pressing apply button in Find & Replace dialog, when no matches where found
Summary: KDevelop crashes after pressing apply button in Find & Replace dialog, when n...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 4.1.60
Platform: Ubuntu Linux
: NOR crash
Target Milestone: 4.2.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-01 18:31 UTC by Chaos A.D.
Modified: 2013-04-17 22:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chaos A.D. 2010-12-01 18:31:53 UTC
Application: kdevelop (4.1.60)
KDE Platform Version: 4.5.1 (KDE 4.5.1)
Qt Version: 4.7.0
Operating System: Linux 2.6.35-23-generic-pae i686
Distribution: Ubuntu 10.10

-- Information about the crash:
GrepOutputModel::doReplacements() does not check that root item has parents :)

The crash can be reproduced every time.

-- Backtrace:
Application: KDevelop (kdevelop), signal: Segmentation fault
[Current thread is 1 (Thread 0xb2e7e710 (LWP 21654))]

Thread 14 (Thread 0xafa03b70 (LWP 21655)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb6087884 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:236
#2  0xb60f994f in wait (this=0x8d91714, mutex=0x8d91718, time=1000) at thread/qwaitcondition_unix.cpp:86
#3  QWaitCondition::wait (this=0x8d91714, mutex=0x8d91718, time=1000) at thread/qwaitcondition_unix.cpp:160
#4  0xb4d6313d in KDevelop::DUChainPrivate::CleanupThread::run() () from /usr/local/lib/libkdevplatformlanguage.so.3
#5  0xb60f8df9 in QThreadPrivate::start (arg=0x8d91708) at thread/qthread_unix.cpp:266
#6  0xb6082cc9 in start_thread (arg=0xafa03b70) at pthread_create.c:304
#7  0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 13 (Thread 0xae167b70 (LWP 21657)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb5399391 in select () at ../sysdeps/unix/syscall-template.S:82
#2  0xb61d5bb8 in QProcessManager::run (this=0xb632e888) at io/qprocess_unix.cpp:245
#3  0xb60f8df9 in QThreadPrivate::start (arg=0xb632e888) at thread/qthread_unix.cpp:266
#4  0xb6082cc9 in start_thread (arg=0xae167b70) at pthread_create.c:304
#5  0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 12 (Thread 0xac6fcb70 (LWP 21733)):
#0  0xb487de36 in clock_gettime (clock_id=-1266147340, tp=0xac6fbf90) at ../sysdeps/unix/clock_gettime.c:100
#1  0xb615450b in do_gettime () at tools/qelapsedtimer_unix.cpp:105
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:119
#3  0xb622b6e5 in QTimerInfoList::updateCurrentTime (this=0x919e0c4) at kernel/qeventdispatcher_unix.cpp:339
#4  0xb622b72a in QTimerInfoList::timerWait (this=0x919e0c4, tm=...) at kernel/qeventdispatcher_unix.cpp:442
#5  0xb62297a8 in timerSourcePrepareHelper (src=<value optimized out>, timeout=0xac6fc0bc) at kernel/qeventdispatcher_glib.cpp:136
#6  0xb622983d in timerSourcePrepare (source=0x0, timeout=0xb4881ff4) at kernel/qeventdispatcher_glib.cpp:169
#7  0xb47eae6a in g_main_context_prepare () from /lib/libglib-2.0.so.0
#8  0xb47eb279 in ?? () from /lib/libglib-2.0.so.0
#9  0xb47eb848 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#10 0xb622959f in QEventDispatcherGlib::processEvents (this=0x9224138, flags=...) at kernel/qeventdispatcher_glib.cpp:417
#11 0xb61f9609 in QEventLoop::processEvents (this=0xac6fc290, flags=) at kernel/qeventloop.cpp:149
#12 0xb61f9a8a in QEventLoop::exec (this=0xac6fc290, flags=...) at kernel/qeventloop.cpp:201
#13 0xb60f5b7e in QThread::exec (this=0x919c5e8) at thread/qthread.cpp:490
#14 0xb61d835b in QInotifyFileSystemWatcherEngine::run (this=0x919c5e8) at io/qfilesystemwatcher_inotify.cpp:248
#15 0xb60f8df9 in QThreadPrivate::start (arg=0x919c5e8) at thread/qthread_unix.cpp:266
#16 0xb6082cc9 in start_thread (arg=0xac6fcb70) at pthread_create.c:304
#17 0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 11 (Thread 0xacefdb70 (LWP 21736)):
#0  0xb487de36 in clock_gettime (clock_id=-1266147340, tp=0xacefcfc0) at ../sysdeps/unix/clock_gettime.c:100
#1  0xb615450b in do_gettime () at tools/qelapsedtimer_unix.cpp:105
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:119
#3  0xb622b6e5 in QTimerInfoList::updateCurrentTime (this=0x9232354) at kernel/qeventdispatcher_unix.cpp:339
#4  0xb622b72a in QTimerInfoList::timerWait (this=0x9232354, tm=...) at kernel/qeventdispatcher_unix.cpp:442
#5  0xb62297a8 in timerSourcePrepareHelper (src=<value optimized out>, timeout=0xacefd0ec) at kernel/qeventdispatcher_glib.cpp:136
#6  0xb622983d in timerSourcePrepare (source=0x0, timeout=0xb4881ff4) at kernel/qeventdispatcher_glib.cpp:169
#7  0xb47eae6a in g_main_context_prepare () from /lib/libglib-2.0.so.0
#8  0xb47eb279 in ?? () from /lib/libglib-2.0.so.0
#9  0xb47eb848 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#10 0xb622959f in QEventDispatcherGlib::processEvents (this=0x919ba30, flags=...) at kernel/qeventdispatcher_glib.cpp:417
#11 0xb61f9609 in QEventLoop::processEvents (this=0xacefd2c0, flags=) at kernel/qeventloop.cpp:149
#12 0xb61f9a8a in QEventLoop::exec (this=0xacefd2c0, flags=...) at kernel/qeventloop.cpp:201
#13 0xb60f5b7e in QThread::exec (this=0x922dee8) at thread/qthread.cpp:490
#14 0xb4e6e1e8 in KDevelop::CompletionWorkerThread::run() () from /usr/local/lib/libkdevplatformlanguage.so.3
#15 0xb60f8df9 in QThreadPrivate::start (arg=0x922dee8) at thread/qthread_unix.cpp:266
#16 0xb6082cc9 in start_thread (arg=0xacefdb70) at pthread_create.c:304
#17 0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 10 (Thread 0xa83aab70 (LWP 21737)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb5391df6 in __poll (fds=0xb5429ff4, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb47f8a1b in g_poll () from /lib/libglib-2.0.so.0
#3  0xb47eb43c in ?? () from /lib/libglib-2.0.so.0
#4  0xb47eb848 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#5  0xb622959f in QEventDispatcherGlib::processEvents (this=0x922c020, flags=...) at kernel/qeventdispatcher_glib.cpp:417
#6  0xb61f9609 in QEventLoop::processEvents (this=0xa83aa2c0, flags=) at kernel/qeventloop.cpp:149
#7  0xb61f9a8a in QEventLoop::exec (this=0xa83aa2c0, flags=...) at kernel/qeventloop.cpp:201
#8  0xb60f5b7e in QThread::exec (this=0xad8db230) at thread/qthread.cpp:490
#9  0xb4e6e1e8 in KDevelop::CompletionWorkerThread::run() () from /usr/local/lib/libkdevplatformlanguage.so.3
#10 0xb60f8df9 in QThreadPrivate::start (arg=0xad8db230) at thread/qthread_unix.cpp:266
#11 0xb6082cc9 in start_thread (arg=0xa83aab70) at pthread_create.c:304
#12 0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 9 (Thread 0xa639cb70 (LWP 21744)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb60874dc in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0xb514d877 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0xb524c1a0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#3  0xb514d8c1 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=0xb524c1a0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#4  0xb6082cc9 in start_thread (arg=0xa639cb70) at pthread_create.c:304
#5  0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 8 (Thread 0xa50ffb70 (LWP 21779)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb60874dc in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0xb41703a5 in ?? () from /usr/lib/libQtWebKit.so.4
#3  0xb4170481 in ?? () from /usr/lib/libQtWebKit.so.4
#4  0xb6082cc9 in start_thread (arg=0xa50ffb70) at pthread_create.c:304
#5  0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 7 (Thread 0xa3cf8b70 (LWP 21785)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb6087884 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:236
#2  0xb60f7e7a in QMutexPrivate::wait (this=0x898cbf8, timeout=10) at thread/qmutex_unix.cpp:94
#3  0xb60f3466 in QMutex::tryLock (this=0xb74a3388, timeout=10) at thread/qmutex.cpp:346
#4  0xb7492698 in (anonymous namespace)::tryLockForegroundMutexInternal(int) () from /usr/local/lib/libkdevplatforminterfaces.so.3
#5  0xb7492d45 in KDevelop::ForegroundLock::relock() () from /usr/local/lib/libkdevplatforminterfaces.so.3
#6  0xb7492e06 in KDevelop::ForegroundLock::ForegroundLock(bool) () from /usr/local/lib/libkdevplatforminterfaces.so.3
#7  0xb4d341eb in KDevelop::ParseJob::readContents() () from /usr/local/lib/libkdevplatformlanguage.so.3
#8  0xa85495db in PreprocessJob::readContents() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#9  0xa854c808 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#10 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#11 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#12 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#13 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#14 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#15 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#16 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#17 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#18 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#19 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#20 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#21 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#22 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#23 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#24 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#25 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#26 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#27 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#28 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#29 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#30 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#31 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#32 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#33 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#34 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#35 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#36 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#37 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#38 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#39 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#40 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#41 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#42 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#43 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#44 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#45 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#46 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#47 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#48 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#49 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#50 0xb7061904 in ThreadWeaver::JobRunHelper::runTheJob (this=0xa3cf81fc, th=0x9d1a120, job=0xc970f08) at ../../../threadweaver/Weaver/Job.cpp:106
#51 0xb7061c61 in ThreadWeaver::Job::execute (this=0xc970f08, th=0x9d1a120) at ../../../threadweaver/Weaver/Job.cpp:135
#52 0xb7063633 in ThreadWeaver::JobCollectionJobRunner::execute (this=0xbb394e0, t=0x9d1a120) at ../../../threadweaver/Weaver/JobCollection.cpp:82
#53 0xb706403e in ThreadWeaver::JobCollection::execute (this=0xc3d4010, t=0x9d1a120) at ../../../threadweaver/Weaver/JobCollection.cpp:228
#54 0xb706092a in ThreadWeaver::ThreadRunHelper::run (this=0xa3cf82f4, parent=0x8cc7470, th=0x9d1a120) at ../../../threadweaver/Weaver/Thread.cpp:95
#55 0xb706107b in ThreadWeaver::Thread::run (this=0x9d1a120) at ../../../threadweaver/Weaver/Thread.cpp:142
#56 0xb60f8df9 in QThreadPrivate::start (arg=0x9d1a120) at thread/qthread_unix.cpp:266
#57 0xb6082cc9 in start_thread (arg=0xa3cf8b70) at pthread_create.c:304
#58 0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 6 (Thread 0xa34f7b70 (LWP 21786)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb60874dc in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0xb60f7ef2 in QMutexPrivate::wait (this=0x898cc60, timeout=-1) at thread/qmutex_unix.cpp:84
#3  0xb60f35ea in QMutex::lock (this=0xb74a338c) at thread/qmutex.cpp:204
#4  0xb7492bf1 in KDevelop::ForegroundLock::relock() () from /usr/local/lib/libkdevplatforminterfaces.so.3
#5  0xb7492e06 in KDevelop::ForegroundLock::ForegroundLock(bool) () from /usr/local/lib/libkdevplatforminterfaces.so.3
#6  0xb4d354a1 in KDevelop::ParseJob::translateDUChainToRevision(KDevelop::TopDUContext*) () from /usr/local/lib/libkdevplatformlanguage.so.3
#7  0xa854345e in CPPInternalParseJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#8  0xa854168d in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#9  0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#10 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#11 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#12 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#13 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#14 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#15 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#16 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#17 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#18 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#19 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#20 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#21 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#22 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#23 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#24 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#25 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#26 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#27 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#28 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#29 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#30 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#31 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#32 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#33 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#34 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#35 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#36 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#37 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#38 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#39 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#40 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#41 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#42 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#43 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#44 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#45 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#46 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#47 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#48 0xa8541682 in CPPParseJob::parseForeground() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#49 0xa854a633 in PreprocessJob::sourceNeeded(QString&, rpp::Preprocessor::IncludeType, int, bool) () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#50 0xa850a3b3 in rpp::pp::handle_include(bool, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#51 0xa850fda3 in rpp::pp::handle_directive(unsigned int, rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#52 0xa85105bb in rpp::pp::operator()(rpp::Stream&, rpp::Stream&) () from /usr/local/lib/libkdev4cpprpp.so
#53 0xa8510817 in rpp::pp::processFileInternal(QString const&, QByteArray const&, QVector<unsigned int>&) () from /usr/local/lib/libkdev4cpprpp.so
#54 0xa85108b5 in rpp::pp::processFile(QString const&, QByteArray const&) () from /usr/local/lib/libkdev4cpprpp.so
#55 0xa854ca18 in PreprocessJob::run() () from /usr/local/lib/kde4/kdevcpplanguagesupport.so
#56 0xb7061904 in ThreadWeaver::JobRunHelper::runTheJob (this=0xa34f71fc, th=0xa7079a30, job=0xa879938) at ../../../threadweaver/Weaver/Job.cpp:106
#57 0xb7061c61 in ThreadWeaver::Job::execute (this=0xa879938, th=0xa7079a30) at ../../../threadweaver/Weaver/Job.cpp:135
#58 0xb7063633 in ThreadWeaver::JobCollectionJobRunner::execute (this=0xbcc62e0, t=0xa7079a30) at ../../../threadweaver/Weaver/JobCollection.cpp:82
#59 0xb706403e in ThreadWeaver::JobCollection::execute (this=0xcc000a8, t=0xa7079a30) at ../../../threadweaver/Weaver/JobCollection.cpp:228
#60 0xb706092a in ThreadWeaver::ThreadRunHelper::run (this=0xa34f72f4, parent=0x8cc7470, th=0xa7079a30) at ../../../threadweaver/Weaver/Thread.cpp:95
#61 0xb706107b in ThreadWeaver::Thread::run (this=0xa7079a30) at ../../../threadweaver/Weaver/Thread.cpp:142
#62 0xb60f8df9 in QThreadPrivate::start (arg=0xa7079a30) at thread/qthread_unix.cpp:266
#63 0xb6082cc9 in start_thread (arg=0xa34f7b70) at pthread_create.c:304
#64 0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 5 (Thread 0xae968b70 (LWP 22036)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb60874dc in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0xb60f99c7 in wait (this=0xaf1150f0, mutex=0xa982fc68, time=4294967295) at thread/qwaitcondition_unix.cpp:88
#3  QWaitCondition::wait (this=0xaf1150f0, mutex=0xa982fc68, time=4294967295) at thread/qwaitcondition_unix.cpp:160
#4  0xb705f030 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0xaf1150d8, th=0xa02701c8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#5  0xb70627dc in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0xa1fb1528, th=0xa02701c8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80
#6  0xb705e55b in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0xaf1150d8, th=0xa02701c8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356
#7  0xb70628d2 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0xa02701c8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#8  0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0xa02701c8, previous=0xbdf5d08) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#9  0xb706095e in ThreadWeaver::ThreadRunHelper::run (this=0xae9682f4, parent=0xaf1150d8, th=0xa02701c8) at ../../../threadweaver/Weaver/Thread.cpp:87
#10 0xb706107b in ThreadWeaver::Thread::run (this=0xa02701c8) at ../../../threadweaver/Weaver/Thread.cpp:142
#11 0xb60f8df9 in QThreadPrivate::start (arg=0xa02701c8) at thread/qthread_unix.cpp:266
#12 0xb6082cc9 in start_thread (arg=0xae968b70) at pthread_create.c:304
#13 0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 4 (Thread 0x9faffb70 (LWP 22037)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb60874dc in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0xb60f99c7 in wait (this=0xaf1150f0, mutex=0xa982fc68, time=4294967295) at thread/qwaitcondition_unix.cpp:88
#3  QWaitCondition::wait (this=0xaf1150f0, mutex=0xa982fc68, time=4294967295) at thread/qwaitcondition_unix.cpp:160
#4  0xb705f030 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0xaf1150d8, th=0xa9ffae8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#5  0xb70627dc in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0xa1fb1528, th=0xa9ffae8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80
#6  0xb705e55b in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0xaf1150d8, th=0xa9ffae8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356
#7  0xb70628d2 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0xa9ffae8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#8  0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0xa9ffae8, previous=0x0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#9  0xb70628f1 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0xa9ffae8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#10 0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0xa9ffae8, previous=0x0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#11 0xb70628f1 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0xa9ffae8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#12 0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0xa9ffae8, previous=0xbb13820) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#13 0xb706095e in ThreadWeaver::ThreadRunHelper::run (this=0x9faff2f4, parent=0xaf1150d8, th=0xa9ffae8) at ../../../threadweaver/Weaver/Thread.cpp:87
#14 0xb706107b in ThreadWeaver::Thread::run (this=0xa9ffae8) at ../../../threadweaver/Weaver/Thread.cpp:142
#15 0xb60f8df9 in QThreadPrivate::start (arg=0xa9ffae8) at thread/qthread_unix.cpp:266
#16 0xb6082cc9 in start_thread (arg=0x9faffb70) at pthread_create.c:304
#17 0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 3 (Thread 0x9d0ffb70 (LWP 22038)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb60874dc in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0xb60f99c7 in wait (this=0xaf1150f0, mutex=0xa982fc68, time=4294967295) at thread/qwaitcondition_unix.cpp:88
#3  QWaitCondition::wait (this=0xaf1150f0, mutex=0xa982fc68, time=4294967295) at thread/qwaitcondition_unix.cpp:160
#4  0xb705f030 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0xaf1150d8, th=0x8e01170) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#5  0xb70627dc in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0xa1fb1528, th=0x8e01170) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80
#6  0xb705e55b in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0xaf1150d8, th=0x8e01170) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356
#7  0xb70628d2 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0x8e01170) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#8  0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0x8e01170, previous=0x0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#9  0xb70628f1 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0x8e01170) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#10 0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0x8e01170, previous=0x0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#11 0xb70628f1 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0x8e01170) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#12 0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0x8e01170, previous=0x0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#13 0xb70628f1 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0x8e01170) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#14 0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0x8e01170, previous=0x0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#15 0xb70628f1 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0x8e01170) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#16 0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0x8e01170, previous=0x9ff058d0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#17 0xb706095e in ThreadWeaver::ThreadRunHelper::run (this=0x9d0ff2f4, parent=0xaf1150d8, th=0x8e01170) at ../../../threadweaver/Weaver/Thread.cpp:87
#18 0xb706107b in ThreadWeaver::Thread::run (this=0x8e01170) at ../../../threadweaver/Weaver/Thread.cpp:142
#19 0xb60f8df9 in QThreadPrivate::start (arg=0x8e01170) at thread/qthread_unix.cpp:266
#20 0xb6082cc9 in start_thread (arg=0x9d0ffb70) at pthread_create.c:304
#21 0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 2 (Thread 0x9c8feb70 (LWP 22040)):
#0  0xb7745424 in __kernel_vsyscall ()
#1  0xb60874dc in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0xb60f99c7 in wait (this=0xaf1150f0, mutex=0xa982fc68, time=4294967295) at thread/qwaitcondition_unix.cpp:88
#3  QWaitCondition::wait (this=0xaf1150f0, mutex=0xa982fc68, time=4294967295) at thread/qwaitcondition_unix.cpp:160
#4  0xb705f030 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0xaf1150d8, th=0x9fc37be8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#5  0xb70627dc in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0xa1fb1528, th=0x9fc37be8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80
#6  0xb705e55b in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0xaf1150d8, th=0x9fc37be8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356
#7  0xb70628d2 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0x9fc37be8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#8  0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0x9fc37be8, previous=0x0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#9  0xb70628f1 in ThreadWeaver::WorkingHardState::applyForWork (this=0xa1fb1528, th=0x9fc37be8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#10 0xb705f533 in ThreadWeaver::WeaverImpl::applyForWork (this=0xaf1150d8, th=0x9fc37be8, previous=0xbd71478) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#11 0xb706095e in ThreadWeaver::ThreadRunHelper::run (this=0x9c8fe2f4, parent=0xaf1150d8, th=0x9fc37be8) at ../../../threadweaver/Weaver/Thread.cpp:87
#12 0xb706107b in ThreadWeaver::Thread::run (this=0x9fc37be8) at ../../../threadweaver/Weaver/Thread.cpp:142
#13 0xb60f8df9 in QThreadPrivate::start (arg=0x9fc37be8) at thread/qthread_unix.cpp:266
#14 0xb6082cc9 in start_thread (arg=0x9c8feb70) at pthread_create.c:304
#15 0xb53a06be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 1 (Thread 0xb2e7e710 (LWP 21654)):
[KCrash Handler]
#7  QStandardItem::rowCount (this=0xbf6d788) at itemviews/qstandarditemmodel.cpp:1411
#8  0xad91b94a in GrepOutputView::onApply() () from /usr/local/lib/kde4/kdevgrepview.so
#9  0xad90c3a3 in GrepOutputView::qt_metacall(QMetaObject::Call, int, void**) () from /usr/local/lib/kde4/kdevgrepview.so
#10 0xb62008ca in QMetaObject::metacall (object=0x9d6e758, cl=2937061377, idx=165078872, argv=0x9d6e758) at kernel/qmetaobject.cpp:237
#11 0xb62136ad in QMetaObject::activate (sender=0xb5c9cf0, m=0xb605d370, local_signal_index=1, argv=0x0) at kernel/qobject.cpp:3280
#12 0xb56d6f99 in QAction::triggered (this=0xb5c9cf0, _t1=false) at .moc/release-shared/moc_qaction.cpp:263
#13 0xb56d88dc in QAction::activate (this=0xb5c9cf0, event=QAction::Trigger) at kernel/qaction.cpp:1256
#14 0xb5bf5082 in trigger (this=0xbf6d788) at ../../include/QtGui/../../src/gui/kernel/qaction.h:218
#15 QToolButton::nextCheckState (this=0xbf6d788) at widgets/qtoolbutton.cpp:1147
#16 0xb5b0e6b3 in QAbstractButtonPrivate::click (this=0xb79b6f0) at widgets/qabstractbutton.cpp:528
#17 0xb5b0e9ae in QAbstractButton::mouseReleaseEvent (this=0xb347260, e=0xbf908230) at widgets/qabstractbutton.cpp:1121
#18 0xb5bf554c in QToolButton::mouseReleaseEvent (this=0xb347260, e=0xbf908230) at widgets/qtoolbutton.cpp:721
#19 0xb573ce08 in QWidget::event (this=0xb347260, event=0xbf908230) at kernel/qwidget.cpp:8187
#20 0xb5b0ce9e in QAbstractButton::event (this=0xb347260, e=0xbf6d788) at widgets/qabstractbutton.cpp:1080
#21 0xb5bf80ca in QToolButton::event (this=0xb347260, event=0xbf908230) at widgets/qtoolbutton.cpp:1163
#22 0xb56defdc in QApplicationPrivate::notify_helper (this=0x89a7c20, receiver=0xb347260, e=0xbf908230) at kernel/qapplication.cpp:4396
#23 0xb56e5c2e in QApplication::notify (this=0xbf908ca8, receiver=0xb347260, e=0xbf908230) at kernel/qapplication.cpp:3959
#24 0xb658268a in KApplication::notify (this=0xbf908ca8, receiver=0xb347260, event=0xbf908230) at ../../kdeui/kernel/kapplication.cpp:310
#25 0x0804bbcc in KDevelopApplication::notify(QObject*, QEvent*) ()
#26 0xb61fab3b in QCoreApplication::notifyInternal (this=0xbf908ca8, receiver=0xb347260, event=0xbf908230) at kernel/qcoreapplication.cpp:732
#27 0xb56e4094 in sendEvent (receiver=0xb347260, event=0xbf908230, alienWidget=0xb347260, nativeWidget=0xbe0f838, buttonDown=0xb60793c0, lastMouseReceiver=..., spontaneous=true) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#28 QApplicationPrivate::sendMouseEvent (receiver=0xb347260, event=0xbf908230, alienWidget=0xb347260, nativeWidget=0xbe0f838, buttonDown=0xb60793c0, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3058
#29 0xb5772d10 in QETWidget::translateMouseEvent (this=0xbe0f838, event=0xbf90874c) at kernel/qapplication_x11.cpp:4403
#30 0xb5772151 in QApplication::x11ProcessEvent (this=0xbf908ca8, event=0xbf90874c) at kernel/qapplication_x11.cpp:3414
#31 0xb57a136a in x11EventSourceDispatch (s=0x89aade8, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#32 0xb47e7855 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#33 0xb47eb668 in ?? () from /lib/libglib-2.0.so.0
#34 0xb47eb848 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#35 0xb6229565 in QEventDispatcherGlib::processEvents (this=0x898b9e0, flags=...) at kernel/qeventdispatcher_glib.cpp:415
#36 0xb57a0be5 in QGuiEventDispatcherGlib::processEvents (this=0x898b9e0, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#37 0xb61f9609 in QEventLoop::processEvents (this=0xbf908a44, flags=) at kernel/qeventloop.cpp:149
#38 0xb61f9a8a in QEventLoop::exec (this=0xbf908a44, flags=...) at kernel/qeventloop.cpp:201
#39 0xb61fe00f in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#40 0xb56dde07 in QApplication::exec () at kernel/qapplication.cpp:3672
#41 0x08053215 in main ()

Reported using DrKonqi
Comment 1 Chaos A.D. 2010-12-01 18:33:40 UTC
> GrepOutputModel::doReplacements() does not check that root item has parents :)
children, not parents :-)
Comment 2 Milian Wolff 2010-12-01 21:40:38 UTC
commit c6bdd0e59708195498598b0316b052d437b966fd
branch master
Author: Milian Wolff <mail@milianw.de>
Date:   Wed Dec 1 21:40:01 2010 +0100

    make sure we don't try to apply / jump to prev/next item if we don't have any matches
    
    hide apply button when we only search for items
    
    BUG: 258504

diff --git a/plugins/grepview/grepoutputmodel.cpp b/plugins/grepview/grepoutputmodel.cpp
index fd4f2aa..83268e6 100644
--- a/plugins/grepview/grepoutputmodel.cpp
+++ b/plugins/grepview/grepoutputmodel.cpp
@@ -312,7 +312,8 @@ void GrepOutputModel::updateCheckState(QStandardItem* item)
 
 void GrepOutputModel::doReplacements()
 {
-    
+    Q_ASSERT(m_rootItem);
+
     DocumentChangeSet changeSet;
     changeSet.setFormatPolicy(DocumentChangeSet::NoAutoFormat);
     for(int fileRow = 0; fileRow < m_rootItem->rowCount(); fileRow++)
diff --git a/plugins/grepview/grepoutputview.cpp b/plugins/grepview/grepoutputview.cpp
index e02e255..d4ba5e0 100644
--- a/plugins/grepview/grepoutputview.cpp
+++ b/plugins/grepview/grepoutputview.cpp
@@ -48,25 +48,28 @@ GrepOutputView::GrepOutputView(QWidget* parent)
     setWindowIcon(SmallIcon("edit-find"));
     
     m_apply = new QAction(KIcon("dialog-ok-apply"), i18n("&Replace"), this);
-    QAction *previous = new QAction(KIcon("go-previous"), i18n("&Previous"), this);
-    QAction *next = new QAction(KIcon("go-next"), i18n("&Next"), this);
+    m_apply->setEnabled(false);
+    m_prev = new QAction(KIcon("go-previous"), i18n("&Previous"), this);
+    m_prev->setEnabled(false);
+    m_next = new QAction(KIcon("go-next"), i18n("&Next"), this);
+    m_next->setEnabled(false);
     QAction *separator = new QAction(this);
     separator->setSeparator(true);
     QAction *change_criteria = new QAction(KIcon("configure"), i18n("&Change criteria"), this);
     
     addAction(m_apply);
-    addAction(previous);
-    addAction(next);
+    addAction(m_prev);
+    addAction(m_next);
     addAction(separator);
     addAction(change_criteria);
     
-    resultsTreeView->setModel(new GrepOutputModel);
+    renewModel();
     resultsTreeView->setItemDelegate(GrepOutputDelegate::self());
     resultsTreeView->setHeaderHidden(true);
-    
+
     connect(m_apply, SIGNAL(triggered(bool)), this, SLOT(onApply()));
-    connect(previous, SIGNAL(triggered(bool)), this, SLOT(selectPreviousItem()));
-    connect(next, SIGNAL(triggered(bool)), this, SLOT(selectNextItem()));
+    connect(m_prev, SIGNAL(triggered(bool)), this, SLOT(selectPreviousItem()));
+    connect(m_next, SIGNAL(triggered(bool)), this, SLOT(selectNextItem()));
     connect(change_criteria, SIGNAL(triggered(bool)), this, SLOT(showDialog()));
 }
 
@@ -77,13 +80,17 @@ GrepOutputView::~GrepOutputView()
 
 GrepOutputModel* GrepOutputView::renewModel()
 {
-    GrepOutputModel* oldModel = model();
+    if (model()) {
+        model()->deleteLater();
+    }
+
     GrepOutputModel* newModel = new GrepOutputModel(resultsTreeView);
     resultsTreeView->setModel(newModel);
+    connect(newModel, SIGNAL(rowsRemoved(QModelIndex, int, int)),
+            this, SLOT(rowsRemoved()));
     connect(resultsTreeView, SIGNAL(activated(QModelIndex)), newModel, SLOT(activate(QModelIndex)));
     connect(newModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(expandRootElement(QModelIndex)));
     connect(newModel, SIGNAL(showErrorMessage(QString,int)), this, SLOT(showErrorMessage(QString)));
-    oldModel->deleteLater();
     return newModel;
 }
 
@@ -105,7 +112,7 @@ void GrepOutputView::setMessage(const QString& msg)
 
 void GrepOutputView::enableReplace(bool enable)
 {
-    m_apply->setEnabled(enable);
+    m_apply->setVisible(enable);
 }
 
 void GrepOutputView::showErrorMessage( const QString& errorMessage )
@@ -122,6 +129,7 @@ void GrepOutputView::showMessage( KDevelop::IStatus* , const QString& message )
 
 void GrepOutputView::onApply()
 {
+    Q_ASSERT(model()->rowCount());
     setEnabled(false);
     model()->doReplacements();
     setEnabled(true);
@@ -138,6 +146,10 @@ void GrepOutputView::expandRootElement(const QModelIndex& parent)
     {
         resultsTreeView->setExpanded(model()->index(0,0), true);
     }
+
+    m_apply->setEnabled(true);
+    m_prev->setEnabled(true);
+    m_next->setEnabled(true);
 }
 
 void GrepOutputView::selectPreviousItem()
@@ -160,4 +172,11 @@ void GrepOutputView::selectNextItem()
         resultsTreeView->setCurrentIndex(next_idx);
         model()->activate(next_idx);
     }
-}
\ No newline at end of file
+}
+
+void GrepOutputView::rowsRemoved()
+{
+    m_apply->setEnabled(model()->rowCount());
+    m_prev->setEnabled(model()->rowCount());
+    m_next->setEnabled(model()->rowCount());
+}
diff --git a/plugins/grepview/grepoutputview.h b/plugins/grepview/grepoutputview.h
index 14cdd68..d4a7416 100644
--- a/plugins/grepview/grepoutputview.h
+++ b/plugins/grepview/grepoutputview.h
@@ -64,6 +64,8 @@ Q_SIGNALS:
     
 private:
     QAction* m_apply;
+    QAction* m_next;
+    QAction* m_prev;
     GrepViewPlugin *m_plugin;
     
 private slots:
@@ -72,6 +74,7 @@ private slots:
     void onApply();
     void showDialog();
     void expandRootElement( const QModelIndex & parent );
+    void rowsRemoved();
 };
 
 #endif // GREPOUTPUTVIEW_H
Comment 3 Aleix Pol 2013-04-17 22:54:24 UTC
Git commit 26538cbadb56610f3c4c5f0f1e1b6ea5900a1353 by Aleix Pol, on behalf of Milian Wolff.
Committed on 01/12/2010 at 21:40.
Pushed by apol into branch '1.1wreck'.

make sure we don't try to apply / jump to prev/next item if we don't have any matches

hide apply button when we only search for items

M  +2    -1    plugins/grepview/grepoutputmodel.cpp
M  +31   -12   plugins/grepview/grepoutputview.cpp
M  +3    -0    plugins/grepview/grepoutputview.h

http://commits.kde.org/kdevplatform/26538cbadb56610f3c4c5f0f1e1b6ea5900a1353