File indexing completed on 2024-04-28 04:58:10
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2000 Simon Hausmann <hausmann@kde.org> 0003 SPDX-FileCopyrightText: 2000-2007 David Faure <faure@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #include "konq_events.h" 0009 0010 #if QT_VERSION_MAJOR < 6 0011 const char *const KonqFileSelectionEvent::s_fileItemSelectionEventName = "Konqueror/FileSelection"; 0012 const char *const KonqFileMouseOverEvent::s_fileItemMouseOverEventName = "Konqueror/FileMouseOver"; 0013 #endif 0014 0015 const int KonqFileSelectionEventType = QEvent::registerEventType(); 0016 0017 KonqFileSelectionEvent::KonqFileSelectionEvent(const KFileItemList &selection, KParts::ReadOnlyPart *part) 0018 #if QT_VERSION_MAJOR < 6 0019 : KParts::Event(s_fileItemSelectionEventName), m_selection(selection), m_part(part) 0020 #else 0021 : QEvent(static_cast<QEvent::Type>(KonqFileSelectionEventType)) 0022 #endif 0023 { 0024 } 0025 0026 KonqFileSelectionEvent::~KonqFileSelectionEvent() 0027 { 0028 } 0029 0030 0031 bool KonqFileSelectionEvent::test(const QEvent *event) 0032 { 0033 0034 #if QT_VERSION_MAJOR < 6 0035 return KParts::Event::test(event, s_fileItemSelectionEventName); 0036 #else 0037 return event->type() == KonqFileSelectionEventType; 0038 #endif 0039 } 0040 0041 const int KonqFileMouseOverEventType = QEvent::registerEventType(); 0042 KonqFileMouseOverEvent::KonqFileMouseOverEvent(const KFileItem &item, KParts::ReadOnlyPart *part) 0043 #if QT_VERSION_MAJOR < 6 0044 : KParts::Event(s_fileItemMouseOverEventName), m_item(item), m_part(part) 0045 #else 0046 : QEvent(static_cast<QEvent::Type>(KonqFileMouseOverEventType)) 0047 #endif 0048 { 0049 } 0050 0051 KonqFileMouseOverEvent::~KonqFileMouseOverEvent() 0052 { 0053 } 0054 0055 bool KonqFileMouseOverEvent::test(const QEvent *event) 0056 { 0057 0058 #if QT_VERSION_MAJOR < 6 0059 return KParts::Event::test(event, s_fileItemMouseOverEventName); 0060 #else 0061 return event->type() == KonqFileMouseOverEventType; 0062 #endif 0063 }