From 4b1680f2428f33dc8ecbf3f4f4b964b0a02e7e06 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 14 Feb 2013 22:40:00 -0600 Subject: Started reworking the instance system. --- data/siglist_imp.h | 156 ----------------------------------------------------- 1 file changed, 156 deletions(-) delete mode 100644 data/siglist_imp.h (limited to 'data/siglist_imp.h') diff --git a/data/siglist_imp.h b/data/siglist_imp.h deleted file mode 100644 index 16ddd9b0..00000000 --- a/data/siglist_imp.h +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright 2013 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "siglist.h" - -template -void SigList::append(const T &value) -{ - QList::append(value); - onItemAdded(value, length() - 1); -} - -template -void SigList::prepend(const T &value) -{ - QList::prepend(value); - onItemAdded(value, 0); -} - -template -void SigList::append(const QList &other) -{ - int index = length(); - QList::append(other); - onItemsAdded(other, index); -} - -template -void SigList::clear() -{ - QList::clear(); - onInvalidated(); -} - -template -void SigList::erase(QList::iterator pos) -{ - T value = *pos; - int index = indexOf(*pos); - QList::erase(pos); - onItemRemoved(value, index); -} - -template -void SigList::erase(QList::iterator first, QList::iterator last) -{ - QList removedValues; - int firstIndex = indexOf(*first); - - for (QList::iterator iter = first; iter < last; iter++) - { - removedValues << *iter; - QList::erase(iter); - } - - onItemsRemoved(removedValues, firstIndex); -} - -template -void SigList::insert(int i, const T &t) -{ - QList::insert(i, t); - onItemAdded(t, i); -} - -template -void SigList::insert(QList::iterator before, const T &t) -{ - QList::insert(before, t); - onItemAdded(t, indexOf(t)); -} - -template -void SigList::move(int from, int to) -{ - const T &item = at(from); - QList::move(from, to); - onItemMoved(item, from, to); -} - -template -int SigList::removeAll(const T &t) -{ - int retVal = QList::removeAll(t); - onInvalidated(); - return retVal; -} - -template -bool SigList::removeOne(const T &t) -{ - int index = indexOf(t); - if (QList::removeOne(t)) - { - onItemRemoved(t, index); - return true; - } - return false; -} - -template -void SigList::swap(QList &other) -{ - QList::swap(other); - onInvalidated(); -} - -template -void SigList::swap(int i, int j) -{ - const T &item1 = at(i); - const T &item2 = at(j); - QList::swap(i, j); - onItemMoved(item1, i, j); - onItemMoved(item2, j, i); -} - -template -T SigList::takeAt(int i) -{ - T val = QList::takeAt(i); - onItemRemoved(val, i); - return val; -} - -template -T SigList::takeFirst() -{ - return takeAt(0); -} - -template -T SigList::takeLast() -{ - return takeAt(length() - 1); -} - -template -QList &SigList::operator =(const QList &other) -{ - QList::operator =(other); - onInvalidated(); - return *this; -} -- cgit v1.2.3