include_directories( ${CMAKE_SOURCE_DIR}/libkonq ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
-
########### next target ###############
set(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})
--- /dev/null
+#cmakedefine HAVE_KMETADATA
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *\r
***************************************************************************/\r
\r
+#include <config-kmetadata.h>\r
#include "dolphinmainwindow.h"\r
\r
#include <assert.h>\r
QString seq = QKeySequence(Qt::ShiftModifier).toString();\r
seq.chop(1); // chop superfluous '+'\r
QAction* moveAction = popup.addAction(KIcon("goto"),\r
- i18n("&Move Here") + "\t" + seq);\r
+ i18n("&Move Here") + '\t' + seq);\r
\r
seq = QKeySequence(Qt::ControlModifier).toString();\r
seq.chop(1);\r
QAction* copyAction = popup.addAction(KIcon("editcopy"),\r
- i18n("&Copy Here") + "\t" + seq);\r
+ i18n("&Copy Here") + '\t' + seq);\r
\r
seq = QKeySequence(Qt::ControlModifier + Qt::ShiftModifier).toString();\r
seq.chop(1);\r
QAction* linkAction = popup.addAction(KIcon("www"),\r
- i18n("&Link Here") + "\t" + seq);\r
+ i18n("&Link Here") + '\t' + seq);\r
\r
popup.addSeparator();\r
popup.addAction(KIcon("stop"), i18n("Cancel"));\r
\r
const bool del = KMessageBox::warningContinueCancel(this,\r
text,\r
- QString::null,\r
+ QString(),\r
KGuiItem(i18n("Delete"), KIcon("editdelete"))\r
) == KMessageBox::Continue;\r
if (del) {\r
// assure a proper default size if Dolphin runs the first time\r
resize(640, 480);\r
}\r
- \r
+ #ifdef HAVE_KMETADATA\r
if (!DolphinApplication::app()->metadataLoader()->storageUp())\r
activeView()->statusBar()->setMessage(i18n("Failed to contact Nepomuk service, annotation and tagging are disabled."), DolphinStatusBar::Error);\r
+ #endif\r
}\r
\r
void DolphinMainWindow::loadSettings()\r
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);
void DolphinView::updateItemCount()
{
if (m_showProgress) {
- m_statusBar->setProgressText(QString::null);
+ m_statusBar->setProgressText(QString());
m_statusBar->setProgress(100);
m_showProgress = false;
}
// 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()));
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()));
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()));
* 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
MetadataLoader::MetadataLoader()
{
-#ifdef HAVE_NEPOMUK
+#ifdef HAVE_KMETADATA
if (Nepomuk::KMetaData::ResourceManager::instance()->init()) {
m_up = false;
Nepomuk::KMetaData::ResourceManager::instance()->setAutoSync(false);
m_up = true;
}
#else
- m_up = true;
+ m_up = false;
#endif
}
QString MetadataLoader::getAnnotation(const KUrl& file)
{
-#ifdef HAVE_NEPOMUK
+#ifdef HAVE_KMETADATA
if(m_up)
return Nepomuk::KMetaData::File(file.url()).getAnnotation();
else
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
void StatusBarMessageLabel::reset()
{
- m_text = QString::null;
+ m_text.clear();
m_type = DolphinStatusBar::Default;
}
text = i18n("Getting size...");
}
else {
- text = QString::null;
+ text = QString();
QTimer::singleShot(0, this, SLOT(hide()));
}
}
* 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"
KUrl typedUrl(text);
if (typedUrl.hasPass()) {
- typedUrl.setPass(QString::null);
+ typedUrl.setPass(QString());
}
QStringList urls = m_pathBox->urls();
QString hostText = url().host();
if (!url().user().isEmpty()) {
- hostText = url().user() + "@" + hostText;
+ hostText = url().user() + '@' + hostText;
}
if (!m_host) {