File indexing completed on 2024-04-21 15:42:50

0001 /***************************************************************************
0002     These are the private helper classes of the Smb4KNotification 
0003     namespace.
0004                              -------------------
0005     begin                : So Jun 22 2014
0006     copyright            : (C) 2014-2019 by Alexander Reinholdt
0007     email                : alexander.reinholdt@kdemail.net
0008  ***************************************************************************/
0009 
0010 /***************************************************************************
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  *   This program is distributed in the hope that it will be useful, but   *
0017  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
0018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
0019  *   General Public License for more details.                              *
0020  *                                                                         *
0021  *   You should have received a copy of the GNU General Public License     *
0022  *   along with this program; if not, write to the                         *
0023  *   Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston,*
0024  *   MA 02110-1335, USA                                                    *
0025  ***************************************************************************/
0026 
0027 // application specific includes
0028 #include "smb4knotification_p.h"
0029 
0030 // KDE includes
0031 #include <KIOWidgets/KRun>
0032 #include <QApplication>
0033 
0034 
0035 Smb4KNotifier::Smb4KNotifier(const QString& event)
0036 : KNotification(event, KNotification::CloseOnTimeout)
0037 {
0038   if (event == "shareMounted")
0039   {
0040     connect(this, SIGNAL(activated(uint)), SLOT(slotOpenShare()));
0041   }
0042 }
0043 
0044 
0045 Smb4KNotifier::~Smb4KNotifier()
0046 {
0047 }
0048 
0049 
0050 void Smb4KNotifier::setMountpoint(const QUrl& mountpoint)
0051 {
0052   m_mountpoint = mountpoint;
0053 }
0054 
0055 
0056 QUrl Smb4KNotifier::mountpoint() const
0057 {
0058   return m_mountpoint;
0059 }
0060 
0061 
0062 void Smb4KNotifier::slotOpenShare()
0063 {
0064   KRun::runUrl(m_mountpoint, "inode/directory", 0, KRun::RunFlags());
0065 }
0066