1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-04 17:30:55 +00:00

Add libkmetadata detection and minor fixes

SVN_SILENT

svn path=/trunk/KDE/kdebase/apps/; revision=636328
This commit is contained in:
Oscar Blumberg 2007-02-22 20:15:20 +00:00
parent 571e40b057
commit 9c8e7f4e43
12 changed files with 35 additions and 23 deletions

View File

@ -4,7 +4,6 @@ add_subdirectory( servicemenus )
include_directories( ${CMAKE_SOURCE_DIR}/libkonq ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### next target ###############
set(dolphin_SRCS
@ -64,8 +63,16 @@ qt4_add_dbus_adaptor(dolphin_SRCS
org.kde.dolphin.MainWindow.xml
dolphinmainwindow.h DolphinMainWindow)
kde4_add_executable(dolphin ${dolphin_SRCS})
#set(KDE4_KMETADATA kmetadata)
# find Nepomuk's libkmetadata
find_path(KMETADATA_INCLUDE_DIR NAMES kmetadata/kmetadata.h PATHS ${KDE4_INCLUDE_DIR})
find_library(KMETADATA_LIBRARY NAMES kmetadata PATHS ${KDE4_LIB_DIR})
if(KMETADATA_INCLUDE_DIR AND KMETADATA_LIBRARY)
set(KDE4_KMETADATA kmetadata)
set(HAVE_KMETADATA 1)
else(KMETADATA_INCLUDE_DIR AND KMETADATA_LIBRARY)
set(KDE4_KMETADATA "")
endif(KMETADATA_INCLUDE_DIR AND KMETADATA_LIBRARY)
configure_file(config-kmetadata.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kmetadata.h )
target_link_libraries(dolphin ${KDE4_KDECORE_LIBS} ${KDE4_KDEPRINT_LIBS} ${KDE4_KMETADATA} konq)
install(TARGETS dolphin DESTINATION ${BIN_INSTALL_DIR})

View File

@ -0,0 +1 @@
#cmakedefine HAVE_KMETADATA

View File

@ -19,6 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#include <config-kmetadata.h>
#include "dolphinmainwindow.h"
#include <assert.h>
@ -154,17 +155,17 @@ void DolphinMainWindow::dropUrls(const KUrl::List& urls,
QString seq = QKeySequence(Qt::ShiftModifier).toString();
seq.chop(1); // chop superfluous '+'
QAction* moveAction = popup.addAction(KIcon("goto"),
i18n("&Move Here") + "\t" + seq);
i18n("&Move Here") + '\t' + seq);
seq = QKeySequence(Qt::ControlModifier).toString();
seq.chop(1);
QAction* copyAction = popup.addAction(KIcon("editcopy"),
i18n("&Copy Here") + "\t" + seq);
i18n("&Copy Here") + '\t' + seq);
seq = QKeySequence(Qt::ControlModifier + Qt::ShiftModifier).toString();
seq.chop(1);
QAction* linkAction = popup.addAction(KIcon("www"),
i18n("&Link Here") + "\t" + seq);
i18n("&Link Here") + '\t' + seq);
popup.addSeparator();
popup.addAction(KIcon("stop"), i18n("Cancel"));
@ -428,7 +429,7 @@ void DolphinMainWindow::deleteItems()
const bool del = KMessageBox::warningContinueCancel(this,
text,
QString::null,
QString(),
KGuiItem(i18n("Delete"), KIcon("editdelete"))
) == KMessageBox::Continue;
if (del) {
@ -953,9 +954,10 @@ void DolphinMainWindow::init()
// assure a proper default size if Dolphin runs the first time
resize(640, 480);
}
#ifdef HAVE_KMETADATA
if (!DolphinApplication::app()->metadataLoader()->storageUp())
activeView()->statusBar()->setMessage(i18n("Failed to contact Nepomuk service, annotation and tagging are disabled."), DolphinStatusBar::Error);
#endif
}
void DolphinMainWindow::loadSettings()

View File

@ -125,7 +125,7 @@ void DolphinStatusBar::setProgress(int percent)
const QString& defaultText = m_messageLabel->defaultText();
const QString msg(m_messageLabel->text());
if ((percent == 0) && !msg.isEmpty()) {
setMessage(QString::null, Default);
setMessage(QString(), Default);
}
else if ((percent == 100) && (msg != defaultText)) {
setMessage(defaultText, Default);

View File

@ -654,7 +654,7 @@ void DolphinView::updateProgress(int percent)
void DolphinView::updateItemCount()
{
if (m_showProgress) {
m_statusBar->setProgressText(QString::null);
m_statusBar->setProgressText(QString());
m_statusBar->setProgress(100);
m_showProgress = false;
}

View File

@ -83,7 +83,7 @@ EditBookmarkDialog::EditBookmarkDialog(const QString& title,
// create icon widgets
new QLabel(i18n("Icon:"), grid);
m_iconName = icon;
m_iconButton = new QPushButton(SmallIcon(m_iconName), QString::null, grid);
m_iconButton = new QPushButton(SmallIcon(m_iconName), QString(), grid);
m_iconButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(m_iconButton, SIGNAL(clicked()),
this, SLOT(selectIcon()));
@ -103,7 +103,7 @@ EditBookmarkDialog::EditBookmarkDialog(const QString& title,
m_location = new QLineEdit(url.prettyUrl(), locationBox);
m_location->setMinimumWidth(320);
QPushButton* selectLocationButton = new QPushButton(SmallIcon("folder"), QString::null, locationBox);
QPushButton* selectLocationButton = new QPushButton(SmallIcon("folder"), QString(), locationBox);
selectLocationButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(selectLocationButton, SIGNAL(clicked()),
this, SLOT(selectLocation()));

View File

@ -75,7 +75,7 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* par
new QLabel(i18n("Location:"), homeUrlBox);
m_homeUrl = new QLineEdit(settings->homeUrl(), homeUrlBox);
QPushButton* selectHomeUrlButton = new QPushButton(SmallIcon("folder"), QString::null, homeUrlBox);
QPushButton* selectHomeUrlButton = new QPushButton(SmallIcon("folder"), QString(), homeUrlBox);
connect(selectHomeUrlButton, SIGNAL(clicked()),
this, SLOT(selectHomeUrl()));

View File

@ -18,9 +18,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#include <config-kmetadata.h>
#include "metadataloader.h"
#ifdef HAVE_NEPOMUK
#ifdef HAVE_KMETADATA
#include <kmetadata/kmetadata.h>
#endif
@ -29,7 +31,7 @@
MetadataLoader::MetadataLoader()
{
#ifdef HAVE_NEPOMUK
#ifdef HAVE_KMETADATA
if (Nepomuk::KMetaData::ResourceManager::instance()->init()) {
m_up = false;
Nepomuk::KMetaData::ResourceManager::instance()->setAutoSync(false);
@ -37,7 +39,7 @@ MetadataLoader::MetadataLoader()
m_up = true;
}
#else
m_up = true;
m_up = false;
#endif
}
@ -51,7 +53,7 @@ bool MetadataLoader::storageUp() {
QString MetadataLoader::getAnnotation(const KUrl& file)
{
#ifdef HAVE_NEPOMUK
#ifdef HAVE_KMETADATA
if(m_up)
return Nepomuk::KMetaData::File(file.url()).getAnnotation();
else
@ -61,7 +63,7 @@ QString MetadataLoader::getAnnotation(const KUrl& file)
void MetadataLoader::setAnnotation(const KUrl& file, const QString& annotation)
{
#ifdef HAVE_NEPOMUK
#ifdef HAVE_KMETADATA
if(m_up)
Nepomuk::KMetaData::File(file.url()).setAnnotation(annotation);
#endif

View File

@ -303,7 +303,7 @@ bool StatusBarMessageLabel::showPendingMessage()
void StatusBarMessageLabel::reset()
{
m_text = QString::null;
m_text.clear();
m_type = DolphinStatusBar::Default;
}

View File

@ -98,7 +98,7 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */)
text = i18n("Getting size...");
}
else {
text = QString::null;
text = QString();
QTimer::singleShot(0, this, SLOT(hide()));
}
}

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#include "urlnavigatorbutton.h"

View File

@ -343,7 +343,7 @@ void UrlNavigator::slotReturnPressed(const QString& text)
KUrl typedUrl(text);
if (typedUrl.hasPass()) {
typedUrl.setPass(QString::null);
typedUrl.setPass(QString());
}
QStringList urls = m_pathBox->urls();
@ -567,7 +567,7 @@ void UrlNavigator::updateContent()
QString hostText = url().host();
if (!url().user().isEmpty()) {
hostText = url().user() + "@" + hostText;
hostText = url().user() + '@' + hostText;
}
if (!m_host) {