Backport: don't continue to search if we don't define pattern
Backport: don't continue to search if we don't define pattern

svn path=/branches/kdepim/enterprise/kdepim/; revision=938220

lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi